Blame SOURCES/libvirt-qemu-driver-Allow-passing-disk-target-as-top-image-with-block-commit.patch

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