render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 60e014701c6406fd3e1c68a1745e25ffcf918288 Mon Sep 17 00:00:00 2001
Message-Id: <60e014701c6406fd3e1c68a1745e25ffcf918288@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 16 Mar 2020 22:11:37 +0100
Subject: [PATCH] qemuDomainBlockCopyCommon: Record updated flags to block job
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For a long time we've masked out VIR_DOMAIN_BLOCK_COPY_SHALLOW if
there's no backing chain for the copied disk to simplify the code.

One of the refactors of the block copy code caused that we no longer
update the 'flags' variable just the local copies. This was okay until
in ccd4228afff we started storing the job flags in the block job data.

Given that we modify how we call qemu we also should modify @flags so
that the correct value is recorded in the block job data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit c2b6bc73774f6202e6368ea6823ce9b1cf3521f7)

https://bugzilla.redhat.com/show_bug.cgi?id=1803092
Message-Id: <71dccc8326d856c3d014c6290524a9da4a75e2df.1584391726.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_driver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bedd69ea2b..5a4e979907 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18242,8 +18242,10 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
     }
 
     /* clear the _SHALLOW flag if there is only one layer */
-    if (!virStorageSourceHasBacking(disk->src))
+    if (!virStorageSourceHasBacking(disk->src)) {
+        flags &= ~VIR_DOMAIN_BLOCK_COPY_SHALLOW;
         mirror_shallow = false;
+    }
 
     if (qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(mirror,
                                                                 mirror_shallow,
-- 
2.25.1