Bug 975760

Summary: Specifying virtio interface ('iface' parameter) breaks the appliance attach-method - libguestfs hangs
Product: Red Hat Enterprise Linux 6 Reporter: bfan
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: leiwang, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.9-5.el6 Doc Type: Bug Fix
Doc Text:
Cause: Using the (very obscure and deprecated) 'iface' parameter when adding a drive. Consequence: Libguestfs would hang. Fix: Libguestfs has been fixed so it can understand a mix of different interfaces (iface parameters). Result: Libguestfs no longer hangs.
Story Points: ---
Clone Of:
: 975771 975797 (view as bug list) Environment:
Last Closed: 2013-11-21 04:45:22 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:
Bug Depends On: 975797    
Bug Blocks: 975771    

Description bfan 2013-06-19 10:06:30 UTC
Description of problem:
add-drive-ro-with-if will hung when specified virtio type.


Version-Release number of selected component (if applicable):
libguestfs-1.20.8-5.el6.x86_64

How reproducible:
100%


Steps to Reproduce:
[root]# qemu-img create /tmp/image 1G
[root]# guestfish add-drive-ro-with-if /tmp/image virtio : run

Actual results:
gueshfish hung

Expected results:
Execute successfully


Additional info:
It works in libguestfs-1.16.32-2.el6.x86_64, Regression

Comment 1 Richard W.M. Jones 2013-06-19 11:19:04 UTC
Appears to be a kernel or qemu bug.

Hangs here:

[    0.599442] EFI Variables Facility v0.08 2004-May-17
[    0.600860] usbcore: registered new interface driver hiddev
[    0.602033] usbcore: registered new interface driver usbhid
[    0.603207] usbhid: v2.6:USB HID core driver
[    0.605303] TCP cubic registered
[    0.606015] Initializing XFRM netlink socket
[    0.606928] NET: Registered protocol family 17
[    0.608057] registered taskstats version 1
[    0.609382] rtc_cmos rtc_cmos: setting system clock to 2013-06-19 11:18:03 UTC (1371640683)
[    0.611160] Initalizing network drop monitor service
[    0.612224] Freeing unused kernel memory: 1264k freed
[    0.613902] Write protecting the kernel read-only data: 10240k
[    0.615592] Freeing unused kernel memory: 904k freed
[    0.617303] Freeing unused kernel memory: 1676k freed
febootstrap: mounting /proc
febootstrap: uptime: 0.62 0.30
febootstrap: ext2 mini initrd starting up: 3.21 zlib
febootstrap: cmdline: panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm-256color
febootstrap: mounting /sys
febootstrap: internal insmod libcrc32c.ko
febootstrap: internal insmod crc32c-intel.ko
insmod: init_module: crc32c-intel.ko: No such device
febootstrap: internal insmod crc-itu-t.ko
febootstrap: internal insmod crc-t10dif.ko
febootstrap: internal insmod crc-ccitt.ko
febootstrap: internal insmod crc7.ko
febootstrap: internal insmod mbcache.ko
febootstrap: internal insmod cdrom.ko
febootstrap: internal insmod sr_mod.ko
febootstrap: internal insmod ata_piix.ko
[    0.684594] scsi0 : ata_piix
[    0.685401] scsi1 : ata_piix
[    0.686063] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc000 irq 14
[    0.687458] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc008 irq 15
febootstrap: internal insmod scsi_transport_spi.ko
febootstrap: internal insmod sym53c8xx.ko
febootstrap: internal insmod sd_mod.ko
febootstrap: internal insmod virtio_ring.ko
febootstrap: internal insmod virtio.ko
febootstrap: internal insmod virtio-rng.ko
febootstrap: internal insmod virtio_console.ko
febootstrap: internal insmod virtio_blk.ko
febootstrap: internal insmod virtio_scsi.ko
febootstrap: internal insmod virtio_net.ko
febootstrap: internal insmod virtio_pci.ko
[    0.929814] virtio-pci 0000:00:02.0: PCI->APIC IRQ transform: INT A -> IRQ 10
[    0.945933] scsi2 : Virtio SCSI HBA
[    0.947608] scsi 2:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    0.12 PQ: 0 ANSI: 5
[    0.951139] virtio-pci 0000:00:03.0: PCI->APIC IRQ transform: INT A -> IRQ 11
[    0.985209] virtio-pci 0000:00:04.0: PCI->APIC IRQ transform: INT A -> IRQ 11
[    0.995864] sd 2:0:0:0: [sda] 8388608 512-byte logical blocks: (4.29 GB/4.00 GiB)
[    0.999219] sd 2:0:0:0: [sda] Write Protect is off
[    1.000911] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.007809]  sda:
[    1.008793]  vda: unknown partition table
[    1.010457] sd 2:0:0:0: [sda] Attached SCSI disk
[    1.012172]  unknown partition table
febootstrap: internal insmod virtio_balloon.ko
febootstrap: internal insmod jbd2.ko
[    1.029154] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2
febootstrap: internal insmod ext4.ko
febootstrap: internal insmod ext2.ko

Comment 2 Richard W.M. Jones 2013-06-19 11:20:53 UTC
Actually I see what's happening.  It's a bug in the
calculation of the appliance disk.  The kernel command
line has root=/dev/sdb but that device won't exist.
/dev/vda is the virtio disk, and /dev/sda is the
appliance disk.

Comment 3 Richard W.M. Jones 2013-06-19 11:25:10 UTC
Just a note that this bug is similar but different:

https://bugzilla.redhat.com/show_bug.cgi?id=892272

The current bug happens in the appliance backend.

Comment 6 bfan 2013-07-01 02:26:49 UTC
Verified with libguestfs-1.20.9-5.el6

[root]# qemu-img create /tmp/image 1G
Formatting '/tmp/image', fmt=raw size=1073741824 
[root]# guestfish add-drive-ro-with-if /tmp/image virtio : run : list-devices
/dev/vda

Change the status to verified

Comment 10 errata-xmlrpc 2013-11-21 04:45:22 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-2013-1536.html