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 888008 - RFE: qemu-img should be able to report the amount of space used by a qcow2 image stored on a block device
Summary: RFE: qemu-img should be able to report the amount of space used by a qcow2 im...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 896690 647386 887909 977089 1083310 1196199
TreeView+ depends on / blocked
 
Reported: 2012-12-17 20:02 UTC by Federico Simoncelli
Modified: 2015-02-25 13:11 UTC (History)
16 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.361.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
: 977089 (view as bug list)
Environment:
Last Closed: 2013-11-21 05:59:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1553 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2013-11-20 21:40:29 UTC

Description Federico Simoncelli 2012-12-17 20:02:25 UTC
Description of problem:
qemu-img should be able to report the amount of space used by a qcow2 image on a block device.

Version-Release number of selected component (if applicable):
qemu-img-0.12.1.2-2.295.el6_3.4.x86_64

Steps to Reproduce:
# vgcreate testvg01 /dev/mapper/1IET_00010001
# lvcreate -n lvtest01 -L 1G testvg01

# qemu-img create -f qcow2 /dev/testvg01/lvtest01 20G
Formatting '/dev/testvg01/lvtest01', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 

# qemu-img info /dev/testvg01/lvtest01
image: /dev/testvg01/lvtest01
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 0
cluster_size: 65536

Actual results:
There is no command reporting how much space of /dev/testvg01/lvtest01 is in use by the qcow2 image.

Expected results:
qemu-img should provide a way to report the amount of space used.

Additional info:
A patch has been proposed upstream:

http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg01153.html

which provides such functionality through the "check" command:

# qemu-img check /dev/testvg01/lvtest01
No errors were found on the image.
Highest offset in use: 262144

Comment 2 RHEL Program Management 2012-12-21 06:47:19 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 22 Sibiao Luo 2013-07-01 08:59:57 UTC
Discuss with kwolf in IRC that 'Highest offset in use' has been renamed to 'Image end offset' during patch review. And i did not reproduce this issue with qemu-kvm-360 and qemu-kvm-355, both of them were ok. kwolf said that he git checkout qemu-kvm-0.12.1.2-2.360.el6.

Verify this issue on qemu-kvm-0.12.1.2-2.376.el6.x86_64.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-392.el6.x86_64
qemu-kvm-0.12.1.2-2.376.el6.x86_64

Steps and results:
1.create a lvm.
# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created
# vgcreate vg-90.100-sluo /dev/sdb
  Volume group "vg-90.100-sluo" successfully created
# lvcreate -L 20G -n lv-90-100-sluo /dev/vg-90.100-sluo
  Logical volume "lv-90-100-sluo" created
2.create qcow2 to the lvm.
# qemu-img create -f qcow2 /dev/vg-90.100-sluo/lv-90-100-sluo 20G
Formatting '/dev/vg-90.100-sluo/lv-90-100-sluo', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 lazy_refcounts=off 
3.check the image info.
# qemu-img info /dev/vg-90.100-sluo/lv-90-100-sluo
image: /dev/vg-90.100-sluo/lv-90-100-sluo
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 0
cluster_size: 65536

# qemu-img check /dev/vg-90.100-sluo/lv-90-100-sluo
No errors were found on the image.
Image end offset: 262144

4.check if it's there with --output=json
# qemu-img check /dev/vg-90.100-sluo/lv-90-100-sluo --output=json
{
    "image-end-offset": 262144, 
    "total-clusters": 327680, 
    "check-errors": 0, 
    "filename": "/dev/vg-90.100-sluo/lv-90-100-sluo", 
    "format": "qcow2"
}

Base on above, this issue has been fixed correctly, set verified status. please correct me if any mistake.

Best Regards,
sluo

Comment 24 errata-xmlrpc 2013-11-21 05:59:26 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.

http://rhn.redhat.com/errata/RHSA-2013-1553.html


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