Bug 1170842

Summary: qemu-img convert intermittently corrupts output images
Product: Red Hat Enterprise Linux 6 Reporter: Tony Breeds <tony>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: bsarathy, chayang, juzhang, mkenneth, pbrady, rbalakri, tony, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-10 00:35:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tony Breeds 2014-12-05 01:26:16 UTC
qemu uses fiemap to detect holes in images.  Under certain circumstances this will corrupt the output image.

After checking the Centos 6 source code I believe that this issue affects RHEL6 generally.

This issue was discovered in the context of openstack, but isn't limited to that scope.

Please see the linked LP bug for more details and links to patches that woul need to be backported.  The qemu 1.5 code base is quite different to 2.x so I don't expect that patches to just apply.

For the record this is the same issue covered in RHBZs:
https://bugzilla.redhat.com/show_bug.cgi?id=1166605
https://bugzilla.redhat.com/show_bug.cgi?id=1160237
https://bugzilla.redhat.com/show_bug.cgi?id=1167224
https://bugzilla.redhat.com/show_bug.cgi?id=1142331

Comment 2 Pádraig Brady 2014-12-09 12:04:08 UTC
Hi Tony. I didn't think RHEL 6 was affected.

I checked these srpms:
qemu-kvm-rhev-0.12.1.2-2.445.el6.src.rpm
qemu-kvm-0.12.1.2-2.448.el6_6.src.rpm

What version are you seeing this with?

Comment 3 Tony Breeds 2014-12-10 00:04:19 UTC
I grabbed the Centos 6 source as I no longer have access to RHEL sources.

qemu-kvm-0.12.1.2-2.445.el6.src.rpm

balder:qemu-kvm tony8129$ grep -Ern fm_flags .
./SOURCES/qemu-1.5.3/block/raw-posix.c:1111:    f.fm.fm_flags = 0;
./SOURCES/qemu-1.5.3/linux-user/syscall_types.h:239:       TYPE_INT, /* fm_flags */

line 1111 is in:

static int coroutine_fn raw_co_is_allocated(BlockDriverState *bs,
                                            int64_t sector_num,
                                            int nb_sectors, int *pnum)

Which looks problematic to me.  What I didn't check was if the build sets CONFIG_FIEMAP

Comment 4 Pádraig Brady 2014-12-10 00:35:31 UTC
I think you may have multiple srpms installed and you're grepping the el7 one my mistake (notice the qemu-1.5.3) ?

I'll mark this as invalid for now.

thanks

Comment 5 Tony Breeds 2014-12-11 05:21:27 UTC
You're correct.  Very sorry.