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': http://libguestfs.org/virt-builder.1.html
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.
From https://bugs.launchpad.net/qemu/+bug/1368815/comments/8: FWIW the following 2 commits in qemu master resolve the issue for qemu-img. http://git.qemu.org/?p=qemu.git;a=commit;h=38c4d0aea3e1264c86e282d99560330adf2b6e25 http://git.qemu.org/?p=qemu.git;a=commit;h=7c15903789953ead14a417882657d52dc0c19a24 If possible they should be back ported to trusty and utopic. You'll also need something like: http://git.qemu.org/?p=qemu.git;a=commit;h=4f11aa8a40351b28c0e67c7276e0003b38cc46ac before my 2 patches.
qemu-2.1.2-7.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/qemu-2.1.2-7.fc21
Package qemu-2.1.2-7.fc21: * 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: https://admin.fedoraproject.org/updates/FEDORA-2014-16075/qemu-2.1.2-7.fc21 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.