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 1297653 - "qemu-img convert" can't create a fully allocated image passed a "-S 0" option
Summary: "qemu-img convert" can't create a fully allocated image passed a "-S 0" option
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.8
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Hanna Czenczek
QA Contact: Ping Li
Yehuda Zimmerman
URL:
Whiteboard:
Depends On:
Blocks: 1359965 1364808
TreeView+ depends on / blocked
 
Reported: 2016-01-12 06:27 UTC by xiagao
Modified: 2017-03-21 09:36 UTC (History)
15 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.495.el6
Doc Type: Bug Fix
Doc Text:
"-S 0" for "qemu-img convert" now works correctly Previously, specifying the "-S 0" option with "qemu-img convert" did not always explicitly write zeroes to all sparse areas in the output file. As a result, running "qemu-img convert -S 0" did not always result in a fully allocated output file. With this update, the command has been fixed, and running "qemu-img convert -S 0" always results in a fully allocated output file. Note that the qcow2 format offers a different preallocation option which can convert images to fully allocated output files faster than using the "-S 0" option. However, with other formats, this can only be achieved with the "-S 0" option.
Clone Of:
Environment:
Last Closed: 2017-03-21 09:36:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0621 0 normal SHIPPED_LIVE Moderate: qemu-kvm security and bug fix update 2017-03-21 12:28:31 UTC

Description xiagao 2016-01-12 06:27:15 UTC
Description of problem:
As summary, "qemu-img convert" can not to create a fully allocated image with a "-S 0" option


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-0.12.1.2-2.483.el6.x86_64
kernel-2.6.32-595.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create a qcow2 image by default.
# qemu-img create -f qcow2 my-data-disk.qcow2 10G
Formatting 'my-data-disk.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536

2.# qemu-img info my-data-disk.qcow2
image: my-data-disk.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 136K
cluster_size: 65536

3."qemu-img convert" can be passed a "-S 0" option to create a fully allocated image
# qemu-img convert -p -f qcow2 -O qcow2 **-S 0** my-data-disk.qcow2 dest.image
(100.00/100%)

4.# qemu-img info dest.image

Actual results:
# qemu-img info dest.image 
image: dest.image
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 136K
cluster_size: 65536


Expected results:
verify th disk size is the same to vritual size.
# qemu-img info dest.image
image: dest.image
file format: qcow2
virtual size: **10G** (10737418240 bytes)
**disk size: 10G**


Additional info:
1.this  issue can be reproduced on rhel6.7 release version and rhel7.2.z version
qemu-kvm-rhev-0.12.1.2-2.479.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.479.el6_7.3.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.5.x86_64

Comment 2 xiagao 2016-01-12 06:46:09 UTC
Test it on rhel7.2.z host.

version:
qemu-kvm-rhev-2.3.0-31.el7_2.5.x86_64

steps:
1.create a qcow2 image by default.
# qemu-img create -f qcow2 my-data-disk.qcow2 10G
Formatting 'my-data-disk.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

2.# qemu-img info my-data-disk.qcow2
image: my-data-disk.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

3.# qemu-img convert -p -f qcow2 -O qcow2 -S 0 my-data-disk.qcow2 dest.image    (100.00/100%)

4.# qemu-img info dest.image
image: dest.image
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 2.1M
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

result:
The disk size is not the same with vritual size.

Comment 4 Yash Mankad 2016-10-27 20:33:01 UTC
Fix included in qemu-kvm-0.12.1.2-2.495.el6

Comment 6 Yiqian Wei 2016-10-28 03:29:54 UTC
Reproduce this bug
Host version:
  kernel-2.6.32-642.el6.x86_64
  qemu-kvm-0.12.1.2-2.490.el6.x86_64
Steps to Reproduce:
1.create a qcow2 image by default.
# qemu-img create -f qcow2 my-data-disk.qcow2 10G
Formatting 'my-data-disk.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536

2.# qemu-img info my-data-disk.qcow2 
image: my-data-disk.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 196K
cluster_size: 65536

3.# qemu-img convert -p -f qcow2 -O qcow2 -S 0 my-data-disk.qcow2 dest.image
    (100.00/100%)

4.# qemu-img info dest.image 
image: dest.image
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 196K
cluster_size: 65536

Result:
The disk size is not the same with vritual size.
-------------------------------------------------
Verify this bug on "qemu-kvm-0.12.1.2-2.495.el6.x86_64" as same steps above.

Test results:The disk size is the same with vritual size.
# qemu-img info dest.image 
image: dest.image
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 10G
cluster_size: 65536

According to result above,this bug has been fixed.

Comment 7 Ping Li 2016-10-31 05:48:31 UTC
(In reply to Yiqian Wei from comment #6)
> Reproduce this bug
> Host version:
>   kernel-2.6.32-642.el6.x86_64
>   qemu-kvm-0.12.1.2-2.490.el6.x86_64
> Steps to Reproduce:
> 1.create a qcow2 image by default.
> # qemu-img create -f qcow2 my-data-disk.qcow2 10G
> Formatting 'my-data-disk.qcow2', fmt=qcow2 size=10737418240 encryption=off
> cluster_size=65536
> 
> 2.# qemu-img info my-data-disk.qcow2 
> image: my-data-disk.qcow2
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 196K
> cluster_size: 65536
> 
> 3.# qemu-img convert -p -f qcow2 -O qcow2 -S 0 my-data-disk.qcow2 dest.image
>     (100.00/100%)
> 
> 4.# qemu-img info dest.image 
> image: dest.image
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 196K
> cluster_size: 65536
> 
> Result:
> The disk size is not the same with vritual size.
> -------------------------------------------------
> Verify this bug on "qemu-kvm-0.12.1.2-2.495.el6.x86_64" as same steps above.
> 
> Test results:The disk size is the same with vritual size.
> # qemu-img info dest.image 
> image: dest.image
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 10G
> cluster_size: 65536
> 
> According to result above,this bug has been fixed.

Thanks Yiqian.
Set this BZ as verified.

Comment 12 errata-xmlrpc 2017-03-21 09:36:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2017-0621.html


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