Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1033490

Summary: Cannot upgrade/downgrade qcow2 images
Product: Red Hat Enterprise Linux 7 Reporter: Kevin Wolf <kwolf>
Component: qemu-kvmAssignee: Hanna Czenczek <hreitz>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, hhuang, juzhang, qiguo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-35.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:54:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kevin Wolf 2013-11-22 08:43:58 UTC
Description of problem:
The RHEL 7 qemu implements a newer version of the qcow2 image file format,
which enables new features, but cannot be read by older qemu versions. For new
images, the version can be specified using the 'qemu-img create -o
compat=(0.10|1.1)' option. Bug 1026739 requests to make compat=1.1 the default
for new images.

Upstream qemu allows to upgrade existing images to make use of the new features
and downgrade images to make them usable with older qemu versions (such as the
one of RHEL 6).

This does not work in RHEL 7.


Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-19.el7

How reproducible:
100%

Steps to Reproduce:

A.1 qemu-img create -f qcow2 -o compat=0.10 /tmp/test.qcow2 1G
A.2 qemu-img amend -f qcow2 -o compat=1.1 /tmp/test.qcow2
A.3 qemu-img info /tmp/test.qcow2

B.1 qemu-img create -f qcow2 -o compat=1.1 /tmp/test.qcow2 1G
B.2 qemu-img amend -f qcow2 -o compat=0.10 /tmp/test.qcow2
B.3 qemu-img info /tmp/test.qcow2


Actual results:
Step 2 in each case prints the qemu-img help message.

Expected results:
All commands succeed. In A.3, "compat: 1.1" is printed. In B.3, "compat: 0.10"
is printed.

Comment 1 Miroslav Rezanina 2014-01-09 09:41:41 UTC
Fix included in qemu-kvm-1.5.3-35.el7

Comment 3 Qian Guo 2014-01-21 07:11:53 UTC
Reproduced this bug with qemu-kvm-1.5.3-19.el7.x86_64 & qemu-img-1.5.3-19.el7.x86_64

Steps:
A.
1.#qemu-img create -f qcow2 -o compat=0.10 /tmp/test.qcow2 1G
2.check help of qemu-img
# qemu-img --help |grep amend
# 
* there's no help infos about amend

3.#qemu-img amend -f qcow2 -o compat=1.1 /tmp/test.qcow2
* this command can not be executed, just output the help infos of qemu-img

B.
1.# qemu-img create -f qcow2 -o compat=1.1 /tmp/test.qcow2 1G
2.# qemu-img amend -f qcow2 -o compat=0.10 /tmp/test.qcow2
* this command can not be executed, just output the help infos of qemu-img

So this bug is reproduced by qemu-kvm-1.5.3-19.el7.x86_64 & qemu-img-1.5.3-19.el7.x86_64

Verify this bug with qemu-kvm-1.5.3-37.el7.x86_64 & qemu-img-1.5.3-37.el7.x86_64

Steps:
A.
1.# qemu-img create -f qcow2 -o compat=0.10 /tmp/test.qcow2 1G
Formatting '/tmp/test.qcow2', fmt=qcow2 size=1073741824 compat='0.10' encryption=off cluster_size=65536 lazy_refcounts=off

2.check help of qemu-img
# qemu-img --help |grep amend
  amend [-q] [-f fmt] -o options filename

3.# qemu-img amend -f qcow2 -o compat=1.1 /tmp/test.qcow2
* command can be finished successfully

4.# qemu-img info /tmp/test.qcow2 
image: /tmp/test.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false

So the compat is successfully upgrated to 1.1

B
1.# qemu-img create -f qcow2 -o compat=1.1 /tmp/test.qcow2 1G
Formatting '/tmp/test.qcow2', fmt=qcow2 size=1073741824 compat='1.1' encryption=off cluster_size=65536 lazy_refcounts=off

2.# qemu-img amend -f qcow2 -o compat=0.10 /tmp/test.qcow2

3.# qemu-img info /tmp/test.qcow2 
image: /tmp/test.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 0.10
So the compat is successfully downgrade to 0.10

So according to above, this bug has been fixed.

Comment 5 Ludek Smid 2014-06-13 10:54:45 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.