提交 5339f57a 编写于 作者: P Peter Krempa

qemu: migration: Properly export backend for NBD storage migration

With -blockdev we must use the nodename as the export but we must keep
the name of the export as it was before to ensure compatiblity.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 83137f5d
......@@ -392,6 +392,8 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i];
g_autofree char *diskAlias = NULL;
const char *exportname = NULL;
const char *devicename = NULL;
/* check whether disk should be migrated */
if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
......@@ -407,6 +409,14 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
if (!(diskAlias = qemuAliasDiskDriveFromDisk(disk)))
goto cleanup;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
exportname = diskAlias;
devicename = disk->src->nodeformat;
} else {
exportname = NULL;
devicename = diskAlias;
}
if (qemuDomainObjEnterMonitorAsync(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
goto cleanup;
......@@ -422,7 +432,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
goto exit_monitor;
}
if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, NULL, true, NULL) < 0)
if (qemuMonitorNBDServerAdd(priv->mon, devicename, exportname, true, NULL) < 0)
goto exit_monitor;
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册