[PATCH 3/4] qemu: Fix value of 'device' argument for blockdev-mirror

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

 



When using blockdev configurations the 'device' argument of
'blockdev-mirror' must correspond to the topmost node in the block node
graph. Libvirt didn't do this properly in case when 'copy_on_read'
option was enabled on the disk.

Use qemuDomainDiskGetTopNodename to fix it for the blockdev-mirror calls
in qemuDomainBlockCopy and the non-shared-storage migration.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c    | 2 +-
 src/qemu/qemu_migration.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3218dc0e23..9e2a94306c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18386,7 +18386,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,

     if (blockdev) {
         ret = qemuMonitorBlockdevMirror(priv->mon, job->name, true,
-                                        disk->src->nodeformat,
+                                        qemuDomainDiskGetTopNodename(disk),
                                         mirror->nodeformat, bandwidth,
                                         granularity, buf_size, mirror_shallow);
     } else {
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 29d228a8d9..d7814208a2 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -931,7 +931,7 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driver,

     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
         jobname = diskAlias;
-        sourcename = disk->src->nodeformat;
+        sourcename = qemuDomainDiskGetTopNodename(disk);
         persistjob = true;
     } else {
         jobname = NULL;
-- 
2.24.1





[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