Bug 556482

Summary: Incorrect error reporting when passing QEMU a disk image with wrong format
Product: [Fedora] Fedora Reporter: Daniel Berrange <berrange>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: amit.shah, berrange, crobinso, dwmw2, itamar, jaswinder, jforbes, quintela, tburke, virt-maint
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 18:50:53 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Daniel Berrange 2010-01-18 10:11:01 EST
Description of problem:

If you spawn qemu using -drive parameter, and tell it to use  format=qcow2, but then have file=/path/to/a/RAW-FILE  point to a non-QCow2 file, it gives a meaningless error message


$ qemu-img info ~/rootdisk.img 
image: /home/berrange/rootdisk.img
file format: raw
virtual size: 1.4M (1474560 bytes)
disk size: 1.4M

$ ~/usr/qemu-git/bin/qemu -drive file=/home/berrange/rootdisk.img,format=qcow2
qemu: could not open disk image /home/berrange/rootdisk.img: Success

It should tell us that this is not a valid QCow2 file. I've not tested, but I suspect other driver formats might have similar problems

Version-Release number of selected component (if applicable):
qemu-system-x86-0.12.1.2-3.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Pass a raw file, but tell qemu it is a qcow2 file
2.
3.
  
Actual results:
qemu: could not open disk image /home/berrange/rootdisk.img: Success

Expected results:
qemu: could not open disk image /home/berrange/rootdisk.img: Not a QCow2 format file

Additional info:
Comment 1 Fedora Admin XMLRPC Client 2010-03-09 11:53:54 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Fedora Admin XMLRPC Client 2010-03-09 12:19:47 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Bug Zapper 2010-07-30 06:49:27 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Cole Robinson 2012-05-20 17:50:57 EDT
Upstream is a bit different:

sudo ./x86_64-softmmu/qemu-system-x86_64 -drive file=/mnt/data/devel/images/winxp.img,format=qcow2
qemu-system-x86_64: -drive file=/mnt/data/devel/images/winxp.img,format=qcow2: could not open disk image /mnt/data/devel/images/winxp.img: Invalid argument

,format=vdi exists with 'Operation not permitted'. So these could still use some work. Reassigning to rawhide for now but probably a good candidate for just moving to the upstream tracker.
Comment 5 Cole Robinson 2012-12-14 18:50:53 EST
Since this was just lingering for years, I've moved it to the upstream qemu tracker:

https://bugs.launchpad.net/qemu/+bug/1090600

Closing.