render / rpms / libvirt

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