Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 921452

Summary: Libvirt detection of vdi file format is broken
Product: Red Hat Enterprise Linux 7 Reporter: tingting zheng <tzheng>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, cwei, dyuan, lcui, moez.roy, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.0.4-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:51:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description tingting zheng 2013-03-14 08:55:20 UTC
Description
Libvirt detection of vdi file format is broken

Version
libvirt-1.0.3-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Use virsh vol-create-as to create volume with vdi format.
# virsh vol-create-as test vdi1.img 2G --format=vdi --allocation=1G
Vol vdi1.img created

# virsh vol-list test --details
Name      Path                                   Type  Capacity  Allocation
---------------------------------------------------------------------------
vdi1.img  /var/lib/libvirt/images/test/vdi1.img  file  2.00 GiB   12.00 KiB

# qemu-img info /var/lib/libvirt/images/test/vdi1.img
image: /var/lib/libvirt/images/test/vdi1.img
file format: vdi
virtual size: 2.0G (2147483648 bytes)
disk size: 12K
cluster_size: 1048576

# virsh pool-refresh test
Pool test refreshed

# virsh vol-list test --details
Name      Path                                   Type     Capacity  Allocation
------------------------------------------------------------------------------
vdi1.img  /var/lib/libvirt/images/test/vdi1.img  file  4096.00 TiB   12.00 KiB


Actual results:
As steps show.

Expected results:
After refresh pool,the size of vdi volume doesn't change.

Additional info:

Comment 2 Ján Tomko 2013-03-14 14:29:48 UTC
Fixed upstream by:
commit 6e46477c23bfed730689fb902ff33c8ca7413ef0
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-03-14 13:24:03 +0100
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-03-14 15:12:06 +0100

    Fix size probing for VDI images
    
    Commit 027bf2ea used the wrong offset: the text field at the start
    of the header has 64 bytes, not 68. [1]
    
    Bug: https://bugzilla.redhat.com/show_bug.cgi?id=921452
    
    [1] https://forums.virtualbox.org/viewtopic.php?p=29267#p29267

Comment 3 Martin Kletzander 2013-03-19 15:46:51 UTC
*** Bug 921419 has been marked as a duplicate of this bug. ***

Comment 4 Huang Wenlong 2013-04-10 01:39:28 UTC
Verify this bug with 
libvirt-1.0.4-1.el7.x86_64

]# virsh vol-list default --details
Name        Path                                Type     Capacity  Allocation
-----------------------------------------------------------------------------
vdi1.img    /var/lib/libvirt/images/vdi1.img    file     2.00 GiB   12.00 KiB




[root@ibm-x3650m3-06 ~]# virsh pool-refresh default
Pool default refreshed

]# virsh vol-list default --details
Name        Path                                Type     Capacity  Allocation
-----------------------------------------------------------------------------
vdi1.img    /var/lib/libvirt/images/vdi1.img    file     2.00 GiB   12.00 KiB


]# qemu-img info /var/lib/libvirt/images/vdi1.img
image: /var/lib/libvirt/images/vdi1.img
file format: vdi
virtual size: 2.0G (2147483648 bytes)
disk size: 12K
cluster_size: 1048576

Comment 5 Ludek Smid 2014-06-13 11:51:00 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.