Bug 548723
Summary: | qemu-img convert silently corrupts when converting from VMDK 4 to raw | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Richard W.M. Jones <rjones> |
Component: | qemu | Assignee: | Fedora Virtualization Maintainers <virt-maint> |
Status: | CLOSED DEFERRED | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | andrew, berrange, crobinso, djuran, dwmw2, fschwarz, hbrock, itamar, jaswinder, jforbes, mbooth, myllynen, quintela, ricardo.arguello, tburke, virt-maint, yupzhang |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-12-14 23:30:18 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 568471, 714159, 818523 |
Description
Richard W.M. Jones
2009-12-18 11:36:07 UTC
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. You don't happen to know if this reproduces with qemu-img > 0.12.x or have a test image I can convert to reproduce handy? Nothing much has changed in the qemu vmdk block driver since I looked at it before (I just checked upstream git), so it's very likely to be still broken. I have some VMDK images, but I warn you that they are very large! If you have somewhere I can upload them to, I can send some your way ... This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle. Changing version to '13'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping I just checked upstream git for the driver again, and apart from code cleanups the code is still the same as ever. Therefore moving the bug -> Rawhide. Updated links: http://oirase.annexia.org/tmp/TestLinux-disk1.vmdk SHA1: 2c81bae89210b075acc51da9d025935470149d55 http://oirase.annexia.org/tmp/TestLinux.ovf SHA1: 30831689b8c6f1b1a1fcbb728769b5f71056a580 Latest qemu-img no longer silently converts to zeroes. Instead it gives a strange error: $ qemu-img convert -f vmdk -O raw TestLinux-disk1.vmdk TestLinux-disk1.raw qemu-img: Could not open 'TestLinux-disk1.vmdk': Operation not permitted qemu-img: Could not open 'TestLinux-disk1.vmdk' > qemu-img: Could not open 'TestLinux-disk1.vmdk': Operation not permitted
This is probably because qemu-img.c code expects brdv_open() to return an errno value
ret = bdrv_open(bs, filename, flags, drv);
if (ret < 0) {
error_report("Could not open '%s': %s", filename, strerror(-ret));
goto fail;
}
while the vmdk_open function just returns -1 for everything:
...
return 0;
fail:
qemu_free(s->l1_backup_table);
qemu_free(s->l1_table);
qemu_free(s->l2_cache);
return -1;
}
and by coincidence, '1 == EPERM'. There are ~4 codepaths in vmdk_open that could fail, the VMDK magic check and then a couple of reads of metadata
There is hope: http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg03130.html http://lists.gnu.org/archive/html/qemu-devel/2011-06/threads.html#00033 The vmdk from "Export as OVF..." doesn't work. # qemu-img convert -O raw esx4.1-rhel5.7-i386-disk1.vmdk test-vmdk.raw qemu-img: Could not open 'esx4.1-rhel5.7-i386-disk1.vmdk' qemu-img: Could not open 'esx4.1-rhel5.7-i386-disk1.vmdk' I copied a vmdk file from ESX storage directly,and then use qemu-img to convert it to raw,it works. # qemu-img convert -O raw esx4.1-rhel5.7-i386-flat.vmdk test-vmdk.raw # ll test-vmdk.raw -rw-r--r--. 1 root root 8589934592 Feb 17 16:58 test-vmdk.raw (In reply to comment #11) > I copied a vmdk file from ESX storage directly,and then use qemu-img to convert > it to raw,it works. > # qemu-img convert -O raw esx4.1-rhel5.7-i386-flat.vmdk test-vmdk.raw > # ll test-vmdk.raw > -rw-r--r--. 1 root root 8589934592 Feb 17 16:58 test-vmdk.raw *-flat.vmdk files are not VMDK. They are just raw files which happen to have a .vmdk extension. So this doesn't really prove anything. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This bug has lingered for forever, so I don't think tracking this in Fedora is going to solve much. Rich, if you can still reproduce this with qemu.git, I'd recommend filing an upstream bug and publishing a reproducer image like you did before. |