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 997977 - Always specify the compat level for qcow2 if qemu-img allows it
Summary: Always specify the compat level for qcow2 if qemu-img allows it
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-16 16:25 UTC by Ján Tomko
Modified: 2014-06-18 00:53 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.1.1-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:57:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ján Tomko 2013-08-16 16:25:53 UTC
There are plans to switch the QEMU default for the QCOW2 format from v2 (compat=0.10) to v3 (compat=1.1).

Let libvirt users decide which format they want by always specifying the compat level (if understood by qemu-img) and providing an option in qemu.conf to adjust the default.

Comment 2 Ján Tomko 2013-08-23 11:32:12 UTC
Upstream discussion:
https://www.redhat.com/archives/libvir-list/2013-August/msg00921.html

Upstream patch always specifying the compat level (default is hard-coded to 0.10):
https://www.redhat.com/archives/libvir-list/2013-August/msg01253.html

Comment 3 Ján Tomko 2013-08-28 09:00:18 UTC
Now pushed upstream:
commit bab2eda6ada1bf832decdc64cc5062e54eb105df
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-20 17:37:08 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-27 12:45:58 +0200

    Always specify qcow2 compat level on qemu-img command line
    
    qemu-img is going to switch the default for QCOW2
    to QCOW2v3 (compat=1.1)
    
    Extend the probing for qemu-img command line options to check
    if -o compat is supported. If the volume definition specifies
    the qcow2 format but no compat level and -o compat is supported,
    specify -o compat=0.10 to create a QCOW2v2 image.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=997977

git describe: v1.1.1-233-gbab2eda

Comment 7 Hao Liu 2013-09-10 10:02:38 UTC
Using packages:
libvirt-1.1.1-3.el7.x86_64
libvirt-1.1.1-4.el7.x86_64
qemu-img-1.5.3-2.el7.x86_64
qemu-img-1.6.50-1.el7.x86_64 (self builf from git repo)

Since the patch on qemu to triger this bug has not been release.
I used a self built qemu package to test. so pls ignore the version
which I made up.

1. Confirm change on qemu.
# qemu-img create test.img 0 -f qcow2

# hexdump test.img | head -n1
**Output**
0000000 4651 fb49 0000 0200 0000 0000 0000 0000 
                        ^    <= for qemu-img-1.5.3-2.el7.x86_64
0000000 4651 fb49 0000 0300 0000 0000 0000 0000 
                        ^    <= for qemu-img-1.6.50-1.el7.x86_64
    
2. Create a storage XML file.
# cat > vol.xml << EOF
<volume>
  <name>test.qcow2</name>
  <key>/var/lib/libvirt/images/test.qcow2</key>
  <source>
  </source>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>1000</allocation>
  <target>
    <path>/var/lib/libvirt/images/test.qcow2</path>
    <format type='qcow2'/>
    <permissions>
      <mode>0644</mode>
      <owner>107</owner>
      <group>107</group>
    </permissions>
  </target>
</volume>
EOF

3. Create a volume using virsh and check its compatibility.
# virsh vol-create default vol.xml
Vol test.qcow2 created from vol.xml

# hexdump /var/lib/libvirt/images/test.qcow2 | head -n1
**Output** 
for libvirt-1.1.1-3:
0000000 4651 fb49 0000 0200 0000 0000 0000 0000
                        ^    <= with qemu-img-1.5.3-2.el7.x86_64
0000000 4651 fb49 0000 0300 0000 0000 0000 0000
                        ^    <= with qemu-img-1.6.50-1.el7.x86_64

for libvirt-1.1.1-4 with either version of qemu-img.
0000000 4651 fb49 0000 0200 0000 0000 0000 0000
                        ^    
This patch prevent the difference when using with future
qemu-img creates new image without specifying compatibility.
It is considered VERIFIED.

Comment 8 Ludek Smid 2014-06-13 10:57:27 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.