]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Simplify allowing access to storage file for block copy
authorPeter Krempa <pkrempa@redhat.com>
Tue, 14 May 2019 15:35:45 +0000 (17:35 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 May 2019 12:22:06 +0000 (14:22 +0200)
One code path open-coded qemuDomainStorageSourceChainAccessAllow badly
and also did not integrate with the locking code.

Replace the separate calls with qemuDomainStorageSourceChainAccessAllow
which does everything internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 2d5afd457a2bac5e2ae84144e21d057f2c914514..0ca217bf08a2d628e889c4030b963d3530a009be 100644 (file)
@@ -17778,9 +17778,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
         /* note that we don't really know whether a part of the backing chain
          * is shared so rolling this back is not as easy. Thus we do it only
          * if there's a backing chain */
-        if (qemuDomainNamespaceSetupDisk(vm, mirror) < 0 ||
-            qemuSetupImageChainCgroup(vm, mirror) < 0 ||
-            qemuSecuritySetImageLabel(driver, vm, mirror, true) < 0)
+        if (qemuDomainStorageSourceChainAccessAllow(driver, vm, mirror) < 0)
             goto endjob;
     } else {
         if (qemuDomainStorageSourceAccessAllow(driver, vm, mirror, false, true) < 0)