[PATCH 28/31] qemu: Convert migration setup code to use 'format' layer node name accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The blockjob, NBD export and setup of the cookie data all care about the
effective nodename.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c            | 6 +++---
 src/qemu/qemu_migration.c        | 4 ++--
 src/qemu/qemu_migration_cookie.c | 3 ++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index edc8edcb70..fa31028db3 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -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);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 7d08df1fc5..949ef6d6d5 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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(&copysrc);
 }
@@ -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);

diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 7f0b7a3412..ba146960d5 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -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);
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux