render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From 6126edc9e0fcf658c95f8ede0c05b72dad6d221b Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <6126edc9e0fcf658c95f8ede0c05b72dad6d221b@dist-git>
3e5111
From: Peter Krempa <pkrempa@redhat.com>
3e5111
Date: Wed, 17 May 2017 17:44:54 +0200
3e5111
Subject: [PATCH] qemu: driver: Allow passing disk target as top image with
3e5111
 block commit
3e5111
3e5111
Since we allow active layer block commit the users are allowed to commit
3e5111
the top of the chain (e.g. vda) into the backing image. The API would
3e5111
not accept that parameter, as it tried to look up the image in the
3e5111
backing chain.
3e5111
3e5111
Add the ability to use the top level image target name explicitly as the
3e5111
top image of the block commit operation.
3e5111
3e5111
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1451394
3e5111
(cherry picked from commit ed61e0b368859b25beb5259f84edd4910cd5218f)
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_driver.c | 2 +-
3e5111
 1 file changed, 1 insertion(+), 1 deletion(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
3e5111
index 8699fb2fe..a0f641fd4 100644
3e5111
--- a/src/qemu/qemu_driver.c
3e5111
+++ b/src/qemu/qemu_driver.c
3e5111
@@ -16933,7 +16933,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
3e5111
     if (qemuDomainDiskBlockJobIsActive(disk))
3e5111
         goto endjob;
3e5111
 
3e5111
-    if (!top)
3e5111
+    if (!top || STREQ(top, disk->dst))
3e5111
         topSource = disk->src;
3e5111
     else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) < 0 ||
3e5111
              !(topSource = virStorageFileChainLookup(disk->src, NULL,
3e5111
-- 
3e5111
2.13.0
3e5111