RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 980771 - [RFE] qemu-img should be able to tell the compat version of a qcow2 image
Summary: [RFE] qemu-img should be able to tell the compat version of a qcow2 image
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Hanna Czenczek
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-03 08:18 UTC by Sibiao Luo
Modified: 2014-06-18 03:30 UTC (History)
11 users (show)

Fixed In Version: qemu-kvm-1.5.3-16.el7
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 13:27:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2013-07-03 08:18:15 UTC
Description of problem:
As we know that we create a qcow2/qcow3 image, but it is hard to tell difference from it was qcow2 or qcow3 that we have to look at the image file header var a qcow2.py script. We can add compat=1.1 or other info to 'qemu-img info xxx' that is a easier and convenient method for users.

Version-Release number of selected component (if applicable):
host info:
3.10.0-0.rc7.64.el7.x86_64
qemu-kvm-1.5.1-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create a qcow3 image and check the info.
# qemu-img create -f qcow2 -o compat=1.1 sluo.qcow3 1G
Formatting 'sluo.qcow3', fmt=qcow2 size=1073741824 compat='1.1' encryption=off cluster_size=65536 lazy_refcounts=off
# qemu-img info sluo.qcow3 
image: sluo.qcow3
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 136K
cluster_size: 65536
2.create a qcow2 image and check the info.
# qemu-img create -f qcow2 sluo.qcow2 1G
Formatting 'sluo.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off
# qemu-img info sluo.qcow2
image: sluo.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 136K
cluster_size: 65536
3.look at the image file header.
# python /root/qemu/tests/qemu-iotests/qcow2.py sluo.qcow3 dump-header
magic                     0x514649fb
version                   3                     <----------------qcow3
backing_file_offset       0x0
backing_file_size         0x0
cluster_bits              16
size                      1073741824
crypt_method              0
l1_size                   2
l1_table_offset           0x30000
refcount_table_offset     0x10000
refcount_table_clusters   1
nb_snapshots              0
snapshot_offset           0x0
incompatible_features     0x0
compatible_features       0x0
autoclear_features        0x0
refcount_order            4
header_length             104

# python /root/qemu/tests/qemu-iotests/qcow2.py sluo.qcow2 dump-header
magic                     0x514649fb
version                   2                     <----------------qcow3
backing_file_offset       0x0
backing_file_size         0x0
cluster_bits              16
size                      1073741824
crypt_method              0
l1_size                   2
l1_table_offset           0x30000
refcount_table_offset     0x10000
refcount_table_clusters   1
nb_snapshots              0
snapshot_offset           0x0
incompatible_features     0x0
compatible_features       0x0
autoclear_features        0x0
refcount_order            4
header_length             72

Actual results:


Expected results:
We can add compat=1.1 and other info(e.g: version ) to 'qemu-img info xxx' that is a easier and convenient method for users.

Additional info:

Comment 1 Sibiao Luo 2013-07-03 08:21:56 UTC
(In reply to Sibiao Luo from comment #0)
> 3.look at the image file header.
> # python /root/qemu/tests/qemu-iotests/qcow2.py sluo.qcow3 dump-header
> magic                     0x514649fb
> version                   3                     <----------------qcow3
> backing_file_offset       0x0
> backing_file_size         0x0
> cluster_bits              16
> size                      1073741824
> crypt_method              0
> l1_size                   2
> l1_table_offset           0x30000
> refcount_table_offset     0x10000
> refcount_table_clusters   1
> nb_snapshots              0
> snapshot_offset           0x0
> incompatible_features     0x0
> compatible_features       0x0
> autoclear_features        0x0
> refcount_order            4
> header_length             104
> 
> # python /root/qemu/tests/qemu-iotests/qcow2.py sluo.qcow2 dump-header
> magic                     0x514649fb
> version                   2                     <----------------qcow3
  version                   2                     <----------------qcow2
> backing_file_offset       0x0
> backing_file_size         0x0
> cluster_bits              16
> size                      1073741824
> crypt_method              0
> l1_size                   2
> l1_table_offset           0x30000
> refcount_table_offset     0x10000
> refcount_table_clusters   1
> nb_snapshots              0
> snapshot_offset           0x0
> incompatible_features     0x0
> compatible_features       0x0
> autoclear_features        0x0
> refcount_order            4
> header_length             72
> 
> Actual results:
# python qcow2.py sluo.qcow3 dump-header | grep version
version                   3
# python qcow2.py sluo.qcow2 dump-header | grep version
version                   2

Comment 2 Huang Wenlong 2013-07-03 08:25:25 UTC
If this bug can be fixed ,please also add lazy_refcounts info ,thanks very much

Comment 3 Ademar Reis 2013-09-03 21:49:00 UTC
There's no qcow3 image format. It's still qcow2, but with some extra features enabled when it's created with compat=1.1.

Nevertheless, this bug is valid: qemu-img should be able to tell the user what's the compat version of a qcow2 image.

Comment 5 Miroslav Rezanina 2013-11-07 14:25:38 UTC
Fix included in qemu-kvm-1.5.3-16.el7

Comment 7 Sibiao Luo 2013-11-26 03:15:16 UTC
Verify this issue on qemu-kvm-1.5.3-19.el7.x86_64 that qemu-img is able to tell the compat version of a qcow2 image successfully.

host info:
# uname -r && rpm -q qemu-kvm
3.10.0-50.el7.x86_64
qemu-kvm-1.5.3-19.el7.x86_64

Steps and results:
# qemu-img create -f qcow2 -o compat=1.1 sluo.qcow3 1G
Formatting 'sluo.qcow3', fmt=qcow2 size=1073741824 compat='1.1' encryption=off cluster_size=65536 lazy_refcounts=off 
# qemu-img info sluo.qcow3
image: sluo.qcow3
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 136K
cluster_size: 65536
Format specific information:
    compat: 1.1             <--------------------
    lazy refcounts: false

# qemu-img create -f qcow2 sluo.qcow2 1G
Formatting 'sluo.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off 
# qemu-img info sluo.qcow2
image: sluo.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 136K
cluster_size: 65536
Format specific information:
    compat: 0.10             <--------------------

Best Regards,
sluo

Comment 8 Ludek Smid 2014-06-13 13:27:56 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.