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 727489

Summary: libvirtxml fails if a volume's size is greater than the size reported by qemu-img
Product: Red Hat Enterprise Linux 6 Reporter: masaya.hasegawa.hp <masaya.hasegawa>
Component: virt-v2vAssignee: Matthew Booth <mbooth>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: rwu, tzheng, whuang, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-v2v-0.8.2-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 14:49:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description masaya.hasegawa.hp 2011-08-02 09:35:35 UTC
Description of problem:

Cannot convert xen local to kvm with useing virt-v2v command 
virt-v2v -i libvirtxml -op pool2  --bridge br0 skyhawk.xml
size (10485760000) < usage (10496020480) at /usr/share/perl5/vendor_perl/Sys/VirtV2V/Connection/LibVirtXMLSource.pm line 157, <$qemuimg> line 4.

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

virt-v2v-0.7.1-3.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. virt-v2v -i libvirtxml -op <pool>  --bridge <bridge name> <xml file>

2.
3.
  
Actual results:
fail 

Expected results:
Convert locally vm successfully

Additional info:

# stat /temp2/xen/skyhawk
  File: `/temp2/xen/skyhawk'
  Size: 10485760000     Blocks: 20500040   IO Block: 4096   regular file
Device: 6815h/26645d    Inode: 16007172    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
...

size (10485760000) < usage (10496020480
20500040*512=10496020480

    146     if (-b $path) {
    147         $is_block = 1;
    148         $usage = $size;
    149         $is_sparse = 0;
    150     } else {
    151         $is_block = 0;
    152         my $st = stat($path);
    153         $usage = $st->blocks * 512;
    154         $is_sparse = $usage < $size ? 1 : 0;
    155     }
    156
    157     die("size ($size) < usage ($usage)") if $size < $usage;

Normally regular file size is less than disk usage if not sparse file.
So line 157 logic seems to be wrong. I think that it be removed.
In fact, after I commented out line 157, virt-v2v was success.

Comment 2 Matthew Booth 2011-08-02 10:49:07 UTC
This is fixed in upstream commit a2eacc7413a800e0e97f5f2e2bf8a43f192d69c0.

Comment 4 Huang Wenlong 2011-08-03 06:03:05 UTC
verify this bug with virt-v2v-0.8.2-1.el6

#virt-v2v -i libvirtxml -os r6 -b breth0 xen-hvm-win2003-i386.xml 

it can convert successfully  and boot

And the "die("size ($size) < usage ($usage)") if $size < $usage;"
already is removed from the source code

Comment 6 Huang Wenlong 2011-08-22 03:13:32 UTC
verify this bug in virt-v2v-0.8.3-1.el6 

# virt-v2v -i libvirtxml -os r6 -b breth0 xen-pv-rhel5.7-x86_64.xml 
xen-pv-rhel5.7-x86_64.img: 100% [====================================]D 0h02m12s
virt-v2v: xen-pv-rhel5.7-x86_64 configured with virtio drivers.

and check the source code  " die("size ($size) < usage ($usage)") if $size < $usage;" 
already removed .

Comment 7 errata-xmlrpc 2011-12-06 14:49:46 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-2011-1615.html