mirror of https://gitee.com/openkylin/libvirt.git
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
83137f5d37
commit
5339f57a0b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue