提交 12664957 编写于 作者: P Peter Krempa

qemu: process: Simplify access to individual disk when reconnecting

Add a helper variable so that we don't have to access the disk via 3
indirections.
上级 802fd245
......@@ -6969,21 +6969,21 @@ qemuProcessReconnect(void *opaque)
* qemu_driver->sharedDevices.
*/
for (i = 0; i < obj->def->ndisks; i++) {
virDomainDiskDefPtr disk = obj->def->disks[i];
virDomainDeviceDef dev;
if (virStorageTranslateDiskSourcePool(conn, obj->def->disks[i]) < 0)
if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
goto error;
/* XXX we should be able to restore all data from XML in the future.
* This should be the only place that calls qemuDomainDetermineDiskChain
* with @report_broken == false to guarantee best-effort domain
* reconnect */
if (qemuDomainDetermineDiskChain(driver, obj, obj->def->disks[i],
true, false) < 0)
if (qemuDomainDetermineDiskChain(driver, obj, disk, true, false) < 0)
goto error;
dev.type = VIR_DOMAIN_DEVICE_DISK;
dev.data.disk = obj->def->disks[i];
dev.data.disk = disk;
if (qemuAddSharedDevice(driver, &dev, obj->def->name) < 0)
goto error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册