]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainBlockCopyCommon: Record updated flags to block job
authorPeter Krempa <pkrempa@redhat.com>
Thu, 27 Feb 2020 14:50:08 +0000 (15:50 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 13 Mar 2020 12:09:12 +0000 (13:09 +0100)
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>
src/qemu/qemu_driver.c

index ac1e1e2f8f03e976d5ad99971bbf5e13d3dd0731..7c227c1e9c60e773fcf51599fba157f911475822 100644 (file)
@@ -17917,8 +17917,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,