Red Hat Bugzilla – Bug 688119
qcow2: qcow2_open doesn't return useful errors
Last modified: 2013-01-09 18:39:49 EST
In error cases, qcow2_open usually returns -1, which is interpreted as EPERM by callers and may cause misleading error messages. Also, qcow2 images with a version number > 2 should return -ENOTSUP, but they really are detected as raw images. These situations happen when an I/O error occurs during qcow2_open or the header is modified to contain values that qemu can't handle today. This may be by a future version of qemu or manually with a hex editor.
Can reproduce this issue with qemu-kvm-0.12.1.2-2.149.el6.x86_64. step 1.create qcow2 image. #qemu-img create -f qcow2 test.qcow2 1G Formatting 'test.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=0 2.check qcow2 info qemu-img info test.qcow2 image: test.qcow2 file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 136K cluster_size: 65536 3.hack qcow2 file,using 3 instead of 2 4.recheck qcow2 info qemu-img info test.qcow2 image: test.qcow2 file format: raw virtual size: 256K (262144 bytes) disk size: 136K Mark qa_ack+
Verified using steps as same as comment2 with qemu-kvm-0.12.1.2-2.153.el6.x86_64 after step 4 #qemu-img info test.qcow2 '' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3 qemu-img: Could not open 'test.qcow2'
According to comment6,set this issue status as verified.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: qcow2_open() error handling returned -1 instead of proper error codes. Cosequence: -1 interpreted as EPERM by callers, causing misleading error messages. Also, qcow2 images with a version number > 2 should return -ENOTSUP, but they would be detected as raw images. Fix: Add proper -errno error return values to qcow2_open(). Result: when opening qcow2 images, permission errors or unsupported qcow versions are properly reported.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,6 +1,6 @@ Cause: qcow2_open() error handling returned -1 instead of proper error codes. -Cosequence: -1 interpreted as EPERM by +Consequence: -1 interpreted as EPERM by callers, causing misleading error messages. Also, qcow2 images with a version number > 2 should return -ENOTSUP, but they would be detected as raw images. Fix: Add proper -errno error return values to qcow2_open().
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0534.html