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