On 06/11/2014 01:53 PM, Adam Litke wrote:
I've tested this with the following script and it seems that
specifying base and top explicitly does not work. Using --shallow
does work for me though. Running the included script yields the
following output:
$ sudo bash /home/alitke/test/test.sh Formatting 'base.img', fmt=raw
error: invalid argument: could not find image '/tmp/snap2.img' in
chain for '/tmp/snap2.img'
base=$PWD/snap1.img
top=$PWD/snap2.img
virsh blockcommit testvm1 vda 0 $base $top --wait --verbose --pivot
Okay, I see the flaw - when looking up an explicit top, we aren't
starting from the active layer. Try omitting the --top argument as a
workaround. Meanwhile, this patch should fix it:
diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index 60dc9c6..aded8e0 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -15575,7 +15575,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
topSource = disk->src;
else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) <
0 ||
!(topSource = virStorageFileChainLookup(disk->src,
-
disk->src->backingStore,
+ disk->src,
top, topIndex,
&top_parent)))
goto endjob;
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org