Bug 613950

Summary: Hot-plugging piix3-usb-uhci doesn't work
Product: Red Hat Enterprise Linux 6 Reporter: juzhang <juzhang>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: armbru, llim, michen, mkenneth, rlerch, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
USB hot plug is not supported in 6.0
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-21 12:21:25 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: 563347, 580953    

Description juzhang 2010-07-13 10:59:07 UTC
Description of problem:
After hot plug in usb disk to linux guest,however,using fdisk -l,can't find this usb storage device in guest. I tested guest rhel6_64,rhel6_32 and rhel5.5_64.all can't find usb storage device.

Version-Release number of selected component (if applicable):
#uname -r
2.6.32-44.el6.x86_64
#rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.91.el6.x86_64

How reproducible:


Steps to Reproduce:
1.Boot guest
#/usr/libexec/qemu-kvm -m 2G -smp 2 -drive file=/root/zhangjunyi/rhel6.32.raw,if=none,id=test,boot=on,cache=none,format=raw -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -drive file=/root/zhangjunyi/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,drive=drive-ide0-1-0 -boot order=cdn,menu=on -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:66:93 -vnc :9 -qmp tcp:0:4445,server,nowait -drive if=floppy,file=/root/zhangjunyi/floppy.img

2.telnet the qmp and issue qmp_capabilities
#{"execute":"qmp_capabilities"}

3.hot add piix3-usb-uhci driver
#{"execute":"device_add","arguments":{"driver":"piix3-usb-uhci","id":"uhciusb1"}}

4.hot add usb storage driver and device
#{"execute":"__com.redhat_drive_add", "arguments": {"file":"/root/zhangjunyi/usb.img","id":"usb1"}}
#{"execute":"device_add","arguments":{"driver":"usb-storage","drive":"usb1","id":"dusb1"}}
  
Actual results:
After step4,In guest,can't find usb storage,just find USB Controller
# lspci 
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 SCSI storage controller: Qumranet, Inc. Virtio block device
00:04.0 Ethernet controller: Qumranet, Inc. Virtio network device
00:05.0 USB Controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
# lsusb 
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Expected results:
Find usb storage and works well

Additional info:
Please note
1.I also using the same steps tested on winxp 32 guest.In window xp guest,can find usb storage and device work well.

2.If using the following steps,can find usb storage and device work well.

1. boot guest with -device piix3-usb-uhci,id=uhci123
 /usr/libexec/qemu-kvm -m 2G -smp 2 -drive file=/root/zhangjunyi/rhel6.32.raw,if=none,id=test,boot=on,cache=none,format=raw -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -drive file=/root/zhangjunyi/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,drive=drive-ide0-1-0 -boot order=cdn,menu=on -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:66:93 -vnc :9 -qmp tcp:0:4445,server,nowait -drive if=floppy,file=/root/zhangjunyi/floppy.img -device piix3-usb-uhci,id=uhci3

2.telnet the qmp and issue qmp_capabilities
#{"execute":"qmp_capabilities"}


3.hot add usb storage driver and device
#{"execute":"__com.redhat_drive_add", "arguments": {"file":"/root/zhangjunyi/usb.img","id":"usb1"}}
#{"execute":"device_add","arguments":{"driver":"usb-storage","drive":"usb1","id":"dusb1"}}

Comment 2 Dor Laor 2010-07-15 12:06:06 UTC
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
USB hot plug is not supported in 6.0

Comment 3 Markus Armbruster 2010-07-23 14:12:24 UTC
According to the description, hot-plugging usb-storage into a system started with a USB controller works just fine.  Problems arise only when we start without a USB controller, then hot-plug piix3-usb-uhci. Therefore, this bug isn't about hot-plugging usb-storage, it's about hot-plugging piix3-usb-uhci.

piix3-usb-uhci is a function of the PIIX3 southbridge.  A real PIIX3 can't be hot-plugged (let alone of its individual functions).  I figure the real bug is that we permit hot-plug of the virtual piix3-usb-uhci.

libvirt always starts guests with -usb, which cold-plugs a piix3-usb-uhci.

Comment 4 juzhang 2010-07-26 02:54:12 UTC
Would you please tell me support piix4-usb-uhci?
I means,boot guest with -device piix4-usb-uhci,id=uhci4 -drive id=usb_disk,file=usbdisk.img,if=none  -device usb-storage,drive=usb_disk?

Comment 5 Markus Armbruster 2010-07-26 07:37:50 UTC
libvirt always uses -usb, which creates piix4-usb-uhci automatically. There is no need for -device piix4-usb-uhci then.

Use other than through libvirt is unsupported.  Thus, the supported way to get piix4-usb-uhci is -usb.

I'm investigating whether we piix4-usb-uhci should be made unavailable with -device.

If this doesn't answer your question (I'm not sure I got it), please rephrase it.

Comment 6 juzhang 2010-07-26 08:29:33 UTC
Would you please tell me which is default between piix3-usb-uhci and piix4-usb-uhci for libvirt uses -usb.if default is piix4-usb-uhci,i want to use piix3-usb-uhci,what should i do?thanks in advance!

Comment 7 Markus Armbruster 2010-07-26 13:38:37 UTC
-usb picks the USB controller appropriate for the board, which is piix3-usb-uhci for the boards we have in RHEL-6.  I don't think using another is supported.

Comment 8 juzhang 2010-07-27 06:17:39 UTC
(In reply to comment #7)
> -usb picks the USB controller appropriate for the board, which is
> piix3-usb-uhci for the boards we have in RHEL-6.  I don't think using another
> is supported.    

Got it,thanks armbru.

Comment 11 Dor Laor 2010-09-21 12:21:25 UTC
Closing this issue since according to https://bugzilla.redhat.com/show_bug.cgi?id=613950#c3 this wasn't meant to work and preventing it is not that important since we're only suporting qemu-kvm through libvirt