Bug 727489 - libvirtxml fails if a volume's size is greater than the size reported by qemu-img
Summary: libvirtxml fails if a volume's size is greater than the size reported by qemu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-v2v
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Matthew Booth
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-02 09:35 UTC by masaya.hasegawa.hp
Modified: 2018-11-14 09:37 UTC (History)
4 users (show)

Fixed In Version: virt-v2v-0.8.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 14:49:46 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1615 0 normal SHIPPED_LIVE Low: virt-v2v security and bug fix update 2011-12-06 00:51:05 UTC

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


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