Created attachment 350570 [details] qemu-img fix convert patch Description of problem: In qemu 0.10.50, qemu-img convert failed to produce a valid image if the source image referenced a backing file. Version-Release number of selected component (if applicable): qemu-img-0.10.50-8.kvm87.fc11.x86_64 (from fedora-virt-preview repo) How reproducible: Happens every time. Steps to Reproduce: Suppose we have an image base.qcow2 1. qemu-img create -b base.qcow2 -f qcow2 temp.qcow2 2. do something with temp.qcow2 (run a vm, write a file, etc.) 3. qemu-img convert -O qcow2 temp.qcow2 rebase.qcow2 Actual results: The content of rebase.qcow2 is exactly the same as temp.qcow2, but without any backing file reference. This makes the file unusable. Expected results: In earlier version, qemu-img convert produced a rebased version (it also removed reference to the backing files but the final image contains merged contents from both base.qcow2 and temp.qcow2) Additional info: I tested this with Fedora 11 with fedora-virt-preview package. I suspect that this was caused by a patch which handles host_device format in qemu-img. Comparing with previous working version (0.10.5), 0.10.50 seems to assume a '-B' options when using qemu-img convert, so it skips writing base content even if the option was not specified. The attached patch seems to correct the situation.
Hi Akkarit, thanks for the report and patch. Can you send this patch upstream? Once it gets accepted upstream, it becomes much easier for us to backport it.
Excellent stuff Akkarit, thanks for getting the patch upstream! The patch is now in F-12 since qemu-0.10.91-0.4.rc1.fc12: http://git.et.redhat.com/?p=qemu-fedora.git;a=commitdiff;h=ca95814efb