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 1257469 - Storage size of guest shows incorrect in virt-manager if lazy refcounts is false and disk type is volume
Summary: Storage size of guest shows incorrect in virt-manager if lazy refcounts is fa...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.2
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-27 07:08 UTC by mxie@redhat.com
Modified: 2016-11-04 01:58 UTC (History)
4 users (show)

Fixed In Version: virt-manager-1.3.2-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 01:58:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshots of guests (199.53 KB, application/zip)
2015-08-27 07:08 UTC, mxie@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2269 0 normal SHIPPED_LIVE virt-manager bug fix and enhancement update 2016-11-03 13:34:19 UTC

Description mxie@redhat.com 2015-08-27 07:08:01 UTC
Created attachment 1067556 [details]
screenshots of guests

Description of problem:
Storage size of guest shows incorrect in virt-manager if lazy refcounts is false and disk type is volume

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1.Create a guest disk
   # qemu-img create -f qcow2 /var/lib/libvirt/images/test.img 10G
     Formatting 'test.img', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off 

 2.Check the guest disk:
   # qemu-img info test.img
     image: test.img
     file format: qcow2
     virtual size: 10G (10737418240 bytes)
     disk size: 196K
     cluster_size: 65536
     Format specific information:
     compat: 1.1
     lazy refcounts: false
 3.Define xml for test guest and set disk type is 'volume'
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source pool='default' volume='test.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
 4.Import the test guest:
   # virsh define test.xml

 5.Check test guest's storage size shows 0.19M in virt-manager,please refer to screenshot of test 


Actual results:
As above

Expected results:
Storage size of guest shows correct in virt-manager

Additional info:
1.If modify test guest's disk type from volume to file in test.xml, its storage size will show 10G in virt-manager,please refer to screenshot of test_modify, so the bug is related to disk type 'volume'
2.*Create another guest via virt-manager. name: generic,check generic guest's disk
   # qemu-img info generic.qcow2 
   image: generic.qcow2
   file format: qcow2
   virtual size: 10G (10737418240 bytes)
   disk size: 2.2M
   cluster_size: 65536
   Format specific information:
     compat: 1.1
     lazy refcounts: true
  *Check generic guest's storage size shows 10G in virt-manager
  *Modify generic guest's xml file to change disk type from file to volume
   # virsh edit generic
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source pool='default' volume='generic.qcow2'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
  *Check generic guest's storage size in virt-manager, it still shows 10G, please refer to screenshot of generic, the difference place with above is 'lazy refcounts: true', so this bug is not only related to 'disk type is volume' but also 'lazy refcounts is false'

Comment 3 Pavel Hrdina 2015-11-05 13:59:42 UTC
Upstream commit:

commit 57fa64e542ff684d5dae9e4259aa11c6cec02ef2
Author: Cole Robinson <crobinso>
Date:   Sat Sep 5 17:59:47 2015 -0400

    details: Use devicedisk path lookup for source_pool

Comment 4 Mike McCune 2016-03-28 23:17:33 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 XiaoyunHu 2016-07-21 03:05:18 UTC
I can reproduce this bug with package:
virt-manager-1.2.1-8.el7.noarch
virt-install-1.2.1-8.el7.noarch

Steps are the same as description above.

Then try to verify with new build:
virt-manager-1.4.0-1.el7.noarch
virt-install-1.4.0-1.el7.noarch

Steps:
1. Create a guest disk
# qemu-img create -f qcow2 /var/lib/libvirt/images/test.img 10G
Formatting '/var/lib/libvirt/images/test.img', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
2. Check the guest disk
# qemu-img info test.img
image: test.img
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. Edit the xml of test guest and Add a disk which disk type is 'volume'
#virsh edit test
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source pool='default' volume='test.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
4.  Import the test guest:
   # virsh define test.xml

5. Check test guest's storage size in virt-manager

Results:
1. The test guest's storage size in virt-manager is 10G.

According to the result above in the latest version of virt-manager, move this bug from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2016-11-04 01:58:07 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/RHBA-2016-2269.html


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