Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 635354 - Can not commit copy-on-write image's data to raw backing-image
Can not commit copy-on-write image's data to raw backing-image
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
urgent Severity high
: rc
: ---
Assigned To: Kevin Wolf
Virtualization Bugs
: Regression, ZStream
Depends On:
Blocks: Rhel6KvmTier1 641835
  Show dependency treegraph
 
Reported: 2010-09-19 03:50 EDT by Mike Cao
Modified: 2013-01-09 18:09 EST (History)
14 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 640949 (view as bug list)
Environment:
Last Closed: 2011-05-19 07:22:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Description Mike Cao 2010-09-19 03:50:50 EDT
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 06:38:45 EDT
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 00:48:09 EDT
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 09:54:09 EDT
    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-29 22:26:00 EST
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 11:03:07 EDT
    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 00:25:56 EDT
    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 07:22:58 EDT
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 08:48:58 EDT
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.