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 1259116 - qemu can not read disk size of libiscsi and it shows 'disk size: unavailable'
Summary: qemu can not read disk size of libiscsi and it shows 'disk size: unavailable'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-02 01:45 UTC by Pei Zhang
Modified: 2016-03-28 09:25 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-20 04:52:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pei Zhang 2015-09-02 01:45:57 UTC
Description of problem:
After formatting qcow2 image of libiscsi, the disk size shows unavailable which is not friendly to user. If this is a block device, maybe the disk size should be set 0 or other appropriate value. 

Version-Release number of selected component (if applicable):
Host:
Kernel:3.10.0-313.el7.x86_64
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-21.el7.x86_64


How reproducible:
100%


Steps to Reproduce:
1.
# qemu-img create -f qcow2 iscsi://10.66.9.120:3260/iqn.2003-01.org.linux-iscsi.dhcp-9-120.x8664:sn.68d22325a05a/0 20G
Formatting 'iscsi://10.66.9.120:3260/iqn.2003-01.org.linux-iscsi.dhcp-9-120.x8664:sn.68d22325a05a/0', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
2.
# qemu-img info iscsi://10.66.9.120:3260/iqn.2003-01.org.linux-iscsi.dhcp-9-120.x8664:sn.68d22325a05a/0
image: iscsi://10.66.9.120:3260/iqn.2003-01.org.linux-iscsi.dhcp-9-120.x8664:sn.68d22325a05a/0
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: unavailable
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false


Actual results:
disk size:unavailable

Expected results:
disk size: 0 (or other appropriate value).


Additional info:

Comment 2 Fam Zheng 2015-09-08 01:25:33 UTC
Actually I think unavailable is more accurate than "0". The allocation status can be retrieved by QEMU scanning each block in the target but that can take unnecessarily long time just to display the summary for the image. So I'm not sure this issue is worth fixing.

Comment 3 Paolo Bonzini 2015-10-19 10:49:43 UTC
I agree with Fam.  Alternatively, qcow2 could store a high-water mark into the header, and qemu-img info could use it.  CCing Kevin for ideas, but I'm okay with CLOSED/NOTABUG.

Comment 4 Kevin Wolf 2015-10-19 13:42:46 UTC
You don't actually have to store another value in the qcow2 header. Scanning
the last refcount block should be quick enough. However, I'm still not
convinced whether that's useful enough to actually do it on every qcow2_open().


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