mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Convert migration setup code to use 'format' layer node name accessors
The blockjob, NBD export and setup of the cookie data all care about the effective nodename. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1baf16fe04
commit
032edf2f11
@ -3406,11 +3406,11 @@ qemuBlockExportAddNBD(virDomainObj *vm,
|
||||
const char *bitmaps[2] = { bitmap, NULL };
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD))
|
||||
return qemuMonitorNBDServerAdd(priv->mon, src->nodeformat,
|
||||
return qemuMonitorNBDServerAdd(priv->mon, qemuBlockStorageSourceGetEffectiveNodename(src),
|
||||
exportname, writable, bitmap);
|
||||
|
||||
if (!(nbdprops = qemuBlockExportGetNBDProps(src->nodeformat, exportname,
|
||||
writable, bitmaps)))
|
||||
if (!(nbdprops = qemuBlockExportGetNBDProps(qemuBlockStorageSourceGetEffectiveNodename(src),
|
||||
exportname, writable, bitmaps)))
|
||||
return -1;
|
||||
|
||||
return qemuMonitorBlockExportAdd(priv->mon, &nbdprops);
|
||||
|
@ -1012,7 +1012,7 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDef *disk,
|
||||
copysrc->tlsHostname = g_strdup(tlsHostname);
|
||||
|
||||
qemuBlockStorageSourceSetStorageNodename(copysrc, g_strdup_printf("migration-%s-storage", disk->dst));
|
||||
copysrc->nodeformat = g_strdup_printf("migration-%s-format", disk->dst);
|
||||
qemuBlockStorageSourceSetFormatNodename(copysrc, g_strdup_printf("migration-%s-format", disk->dst));
|
||||
|
||||
return g_steal_pointer(©src);
|
||||
}
|
||||
@ -1060,7 +1060,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virDomainObj *vm,
|
||||
if (mon_ret == 0)
|
||||
mon_ret = qemuMonitorBlockdevMirror(qemuDomainGetMonitor(vm), diskAlias, true,
|
||||
qemuDomainDiskGetTopNodename(disk),
|
||||
copysrc->nodeformat,
|
||||
qemuBlockStorageSourceGetEffectiveNodename(copysrc),
|
||||
mirror_speed, 0, 0, mirror_shallow,
|
||||
syncWrites);
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_migration_cookie.h"
|
||||
#include "qemu_migration_params.h"
|
||||
#include "qemu_block.h"
|
||||
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
@ -507,7 +508,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
||||
virDomainDiskDef *disk = vm->def->disks[i];
|
||||
qemuBlockStats *entry;
|
||||
|
||||
if (!(entry = virHashLookup(stats, disk->src->nodeformat)))
|
||||
if (!(entry = virHashLookup(stats, qemuBlockStorageSourceGetEffectiveNodename(disk->src))))
|
||||
continue;
|
||||
|
||||
mig->nbd->disks[mig->nbd->ndisks].target = g_strdup(disk->dst);
|
||||
|
Loading…
x
Reference in New Issue
Block a user