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 635354 - Can not commit copy-on-write image's data to raw backing-image
Summary: Can not commit copy-on-write image's data to raw backing-image
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel6KvmTier1 641835
TreeView+ depends on / blocked
 
Reported: 2010-09-19 07:50 UTC by Mike Cao
Modified: 2013-01-09 23:09 UTC (History)
14 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.114.el6
Doc Type: Bug Fix
Doc Text:
Previously, when a QCOW2 image was committed to a backing file, the backing file was erroneously opened as a QCOW2 format file instead of its correct format, which caused a "qemu-img: Error while committing image" error to display. This is fixed to ensure that backing files are now opened in the correct format and images commits execute as expected.
Clone Of:
: 640949 (view as bug list)
Environment:
Last Closed: 2011-05-19 11:22:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 11:20:36 UTC

Description Mike Cao 2010-09-19 07:50:50 UTC
Description of problem:
Can not commit copy-on-write image's data to raw backing-image 

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.54.el6

How reproducible:
100%

Steps to Reproduce:
1.create a raw image #qemu-img create -f raw Mike 5G
2.create snapshot disk : #qemu-img create -F raw -f qcow2 -b Mike Mike.sp
3.write some datas to the snapshot disk 
eg:#qemu-io Mike.sp
qemu-io> write 0 512k -P 3
4.commit snapshot datas to the backing-image 
eg:# qemu-img commit Mike.sp
  
Actual results:
# qemu-img commit Mike.sp
qemu-img: Error while committing image


Expected results:
# qemu-img commit Mike.sp
Image committed.

Additional info:
re-tested on qemu-kvm-0.12.1.2-2.53.el6 , it works fine.

Comment 7 Kevin Wolf 2010-10-07 10:38:45 UTC
Bill asked me to clarify what this bug actually means.

When committing the content of a qcow2 image to its backing file, the backing file is reopened as qcow2 instead of its real format. This means that committing fails when you use other formats for the backing file, most importantly raw. If you do this from within a running VM (using the 'commit' monitor command), the VM will lose access to the disk. The integrity of the image is not harmed.

Comment 10 Mike Cao 2010-10-12 04:48:09 UTC
Verified on qemu-kvm-0.12.1.2-2.115.el6
backding file:
block_device(raw)--->pass
block_device(qcow2)--->pass
file(raw)--->pass
file(qcow2)--->pass

based on above ,this issue has been fixed .

Comment 11 Jaromir Hradilek 2010-10-27 13:54:09 UTC
    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:
Previously, attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error:

  qemu-img: Error while committing image

With this update, this error no longer occurs, and such images can now be committed as expected.

Comment 13 Shirley Zhou 2010-12-30 03:26:00 UTC
Re-verify this bug with package qemu-kvm-0.12.1.2-2.128.el6.x86_64 as following steps:

1. install guest in base image
2. create snapshot for base image
3. start snapshot, and dd 1G size file in guest
4. shutdown snapshot, do snapshot commit
5. start base image, check big file using cksum, if cksum is same, pass

Verify four kind of images as following

block device (qcow2)
block device (raw)
File (qcow2)
File (raw)

All pass, so this bug has been fixed.

Comment 15 Eduardo Habkost 2011-05-05 15:03:07 UTC
    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,5 +1,12 @@
-Previously, attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error:
+Cause: backing file re-opening code opened the backing file with the wrong format.
 
+Consequence:
+
+attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error:
+
   qemu-img: Error while committing image
 
-With this update, this error no longer occurs, and such images can now be committed as expected.+
+Fix: the block device backing file re-open code now re-opens the backing file with the backing file format and not with the format of the snapshot image.
+
+Result: With this update, the 'Error while committing image' error no longer occurs when using 'qemu-img commit', and the images can now be committed as expected.

Comment 16 Misha H. Ali 2011-05-12 04:25:56 UTC
    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,12 +1 @@
-Cause: backing file re-opening code opened the backing file with the wrong format.
+Previously, when a QCOW2 image was committed to a backing file, the backing file was erroneously opened as a QCOW2 format file instead of its correct format, which caused a "qemu-img: Error while committing image" error to display. This is fixed to ensure that backing files are now opened in the correct format and images commits execute as expected.-
-Consequence:
-
-attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error:
-
-  qemu-img: Error while committing image
-
-
-Fix: the block device backing file re-open code now re-opens the backing file with the backing file format and not with the format of the snapshot image.
-
-Result: With this update, the 'Error while committing image' error no longer occurs when using 'qemu-img commit', and the images can now be committed as expected.

Comment 17 errata-xmlrpc 2011-05-19 11:22:58 UTC
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

Comment 18 errata-xmlrpc 2011-05-19 12:48:58 UTC
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


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