[libvirt] [PATCH 11/12] qemu: Simplify allowing access to storage file for block copy

Peter Krempa posted 12 patches 6 years, 8 months ago
[libvirt] [PATCH 11/12] qemu: Simplify allowing access to storage file for block copy
Posted by Peter Krempa 6 years, 8 months ago
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>
---
 src/qemu/qemu_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a9c41d1592..bd04d21907 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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)
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 11/12] qemu: Simplify allowing access to storage file for block copy
Posted by Ján Tomko 6 years, 8 months ago
On Fri, May 17, 2019 at 01:19:57PM +0200, Peter Krempa wrote:
>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>
>---
> src/qemu/qemu_driver.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list