Description of problem:
When using qemu-img convert to/from raw format on files that are not fully flushed to disk corrupt disk images can result.
Version-Release number of selected component (if applicable):
Affects F19 F20 and F21. Fixed in rawhide.
I know it's a little tacky to point to another distro's bug tracker but please see the ubuntu bug referenced below.
It contains the patches to backport to the affected current releases.
I've seen something like this with virt-builder, which required
virt-builder to fsync the image after writing it. In fact
we document it. Search the following page for '--no-sync':
BTW I think your explanation in the launchpad bug may be wrong
(or maybe there are two separate issues). The issue we had is
that the default cache mode in qemu is directsync (using O_DIRECT)
so it bypasses the cache, and using qemu-img before or after qemu
causes it to not read data which is cached and not written to disk.
I'm pretty sure there are 2 issues. I've certainly see the issue you describe above, but not in an openstack context.
In our case the source image is fine. and NOT controlled by qemu (at this point) so it's pretty easy to rule out qemu's cacheing or IO models.
FWIW I've included a link to the RHEL bug for this issue.
FWIW the following 2 commits in qemu master resolve the issue for qemu-img.
If possible they should be back ported to trusty and utopic.
You'll also need something like:
before my 2 patches.
qemu-2.1.2-7.fc21 has been submitted as an update for Fedora 21.
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing qemu-2.1.2-7.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Updated package works on F21.
I've confirmed the fiemap code issue affects F19 and F20 also
qemu-2.1.2-7.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.