render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 60e014701c6406fd3e1c68a1745e25ffcf918288 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <60e014701c6406fd3e1c68a1745e25ffcf918288@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:11:37 +0100
fbe740
Subject: [PATCH] qemuDomainBlockCopyCommon: Record updated flags to block job
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
For a long time we've masked out VIR_DOMAIN_BLOCK_COPY_SHALLOW if
fbe740
there's no backing chain for the copied disk to simplify the code.
fbe740
fbe740
One of the refactors of the block copy code caused that we no longer
fbe740
update the 'flags' variable just the local copies. This was okay until
fbe740
in ccd4228afff we started storing the job flags in the block job data.
fbe740
fbe740
Given that we modify how we call qemu we also should modify @flags so
fbe740
that the correct value is recorded in the block job data.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit c2b6bc73774f6202e6368ea6823ce9b1cf3521f7)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1803092
fbe740
Message-Id: <71dccc8326d856c3d014c6290524a9da4a75e2df.1584391726.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_driver.c | 4 +++-
fbe740
 1 file changed, 3 insertions(+), 1 deletion(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
fbe740
index bedd69ea2b..5a4e979907 100644
fbe740
--- a/src/qemu/qemu_driver.c
fbe740
+++ b/src/qemu/qemu_driver.c
fbe740
@@ -18242,8 +18242,10 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
fbe740
     }
fbe740
 
fbe740
     /* clear the _SHALLOW flag if there is only one layer */
fbe740
-    if (!virStorageSourceHasBacking(disk->src))
fbe740
+    if (!virStorageSourceHasBacking(disk->src)) {
fbe740
+        flags &= ~VIR_DOMAIN_BLOCK_COPY_SHALLOW;
fbe740
         mirror_shallow = false;
fbe740
+    }
fbe740
 
fbe740
     if (qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(mirror,
fbe740
                                                                 mirror_shallow,
fbe740
-- 
fbe740
2.25.1
fbe740