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 700296

Summary: Fail to convert a VM with >=4 virtio devices
Product: Red Hat Enterprise Linux 6 Reporter: Rita Wu <rwu>
Component: virt-v2vAssignee: Matthew Booth <mbooth>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: cshao, cwei, leiwang, qguan, whuang, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 700308 (view as bug list) Environment:
Last Closed: 2011-06-10 08:52:14 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:
Bug Depends On:    
Bug Blocks: 700308    

Description Rita Wu 2011-04-28 03:48:21 UTC
Description of problem:
V2V fails to convert VM with >=4 virtio devices.

#virsh dumpxml kvm-rhel6.1-i386-4vdXX
...
 <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/mnt/sdb/image/kvm-rhel6.1-i386-4vdXX'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='/mnt/sdb/image/kvm-rhel6.1-i386-4vdXX-disk2.img'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='/mnt/sdb/image/kvm-rhel6.1-i386-4vdXX-disk4.img'/>
      <target dev='vdc' bus='virtio'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='/mnt/sdb/image/kvm-rhel6.1-i386-4vdXX-disk3.img'/>
      <target dev='vdd' bus='virtio'/>
    </disk>
...



Version-Release number of selected component (if applicable):
virt-v2v-0.7.1-4.el6.x86_64
libguestfs-1.7.17-15.el6.x86_64
libvirt-0.8.7-6.el6.x86_64
qemu-kvm-0.12.1.2-2.135.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Convert the VM with 4 virtio devices
# LIBGUESTFS_DEBUG=1 virt-v2v -ic qemu+ssh://10.66.72.122/system  -o rhev -op 10.66.90.115:/vol/v2vrwu1/rwu_export kvm-rhel6.1-i386-4vdXX
kvm-rhel6.1-i386-4vdXX: 100% [=========================================================================]D 0h02m12s
kvm-rhel6.1-i386-4vdXX-disk2.img: 100% [===============================================================]D 0h01m07s
kvm-rhel6.1-i386-4vdXX-disk4.img: 100% [===============================================================]D 0h01m08s
kvm-rhel6.1-i386-4vdXX-disk3.img: 100% [===============================================================]D 0h01m07s
new guestfs handle 0x2dc94b0
[00000ms] febootstrap-supermin-helper --verbose -u 36 -g 36 -f checksum '/usr/lib64/guestfs/supermin.d' x86_64
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/2.6.32-71.el6.x86_64 is a directory
picked vmlinuz-2.6.32-71.el6.x86_64 because modpath /lib/modules/2.6.32-71.el6.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00011ms] visiting /usr/lib64/guestfs/supermin.d/ntfs.hostfiles
supermin helper [00011ms] visiting /usr/lib64/guestfs/supermin.d/ntfs.img
supermin helper [00075ms] finished creating appliance
[00080ms] begin testing qemu features
[00098ms] finished testing qemu features
[00100ms] /usr/libexec/qemu-kvm \
    -drive file=/tmp/mjUop0LTIi/ee84623f-0ded-4144-adf2-69bed2e69732/v2v.0fCZ8L97/14f5b67a-8180-48a0-91e9-6185cacf6a1f/ccbc949d-71b9-4d3d-84cc-5b8ff098e3c4,cache=off,if=ide \
    -drive file=/tmp/mjUop0LTIi/ee84623f-0ded-4144-adf2-69bed2e69732/v2v.0fCZ8L97/f582e314-13fb-40eb-b25d-f412b97b0f03/fda0020b-8df1-4810-9486-23bf9aea5926,cache=off,if=ide \
    -drive file=/tmp/mjUop0LTIi/ee84623f-0ded-4144-adf2-69bed2e69732/v2v.0fCZ8L97/c21ca91d-27ab-4b80-aaff-b369765ae8f2/37988862-0842-43e6-a90e-3f3a52565888,cache=off,if=ide \
    -drive file=/tmp/mjUop0LTIi/ee84623f-0ded-4144-adf2-69bed2e69732/v2v.0fCZ8L97/d66950cf-b83a-4d1b-9f1e-484994b8dc7d/47de6f46-1276-4c84-9e55-d4b55b0b8f53,cache=off,if=ide \
    -drive file=/var/lib/virt-v2v/transfer.iso,snapshot=on,if=ide \
    -nodefconfig \
    -enable-kvm \
    -nodefaults \
    -nographic \
    -m 500 \
    -no-reboot \
    -device virtio-serial \
    -serial stdio \
    -chardev socket,path=/tmp/libguestfsGpprEU/sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -netdev user,id=usernet,net=169.254.0.0/16 \
    -device virtio-net-pci,netdev=usernet \
    -kernel /tmp/.guestfs-36/kernel.19020 \
    -initrd /tmp/.guestfs-36/initrd.19020 \
    -append 'panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=xterm ' \
    -drive file=/tmp/.guestfs-36/root.19020,snapshot=on,if=virtio,cache=unsafe
accept_from_daemon: 0x2dc94b0 g->state = 1
recv_from_daemon: 0x2dc94b0 g->state = 1, size_rtn = 0x7fff0a6f297c, buf_rtn = 0x7fff0a6f2940
qemu: too many IDE bus
child_cleanup: 0x2dc94b0: child process died
unexpected end of file when reading from daemon at /usr/share/perl5/vendor_perl/Sys/VirtV2V/GuestfsHandle.pm line 86.
closing guestfs handle 0x2dc94b0 (state 0)

  
Actual results:
Fail to convert VM with >=4 virtio devices

Expected results:
Convert successfully.

Additional info:
I guess the reason is there is no conditional statement to get the interface instead of a fix "ide" in GuestfsHandle.pm:
#cat /usr/share/perl5/vendor_perl/Sys/VirtV2V/GuestfsHandle.pm
...
sub new
{
    my $class = shift;
    my ($storage, $transfer, $isrhev) = @_;

    my $self = {};

    # Open a guest handle
    my $g;
    my $open = sub {
        my $interface = "ide";

        $g = open_guest($storage, rw => 1, interface => $interface);

        # Add the transfer iso if there is one
        $g->add_drive_ro_with_if($transfer, $interface) if (defined($transfer));

        # Enable networking in the guest
        $g->set_network(1);

        $g->launch();
    };

Comment 1 Matthew Booth 2011-06-10 08:52:14 UTC

*** This bug has been marked as a duplicate of bug 681255 ***