Bug 614791 - "device_add" command accept it when pass-through a usb device to guest with a wrong busid:addrid
"device_add" command accept it when pass-through a usb device to guest with...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Virtualization Maintenance
Virtualization Bugs
:
Depends On:
Blocks: 580953
  Show dependency treegraph
 
Reported: 2010-07-15 05:44 EDT by juzhang
Modified: 2010-08-02 05:09 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-02 05:09:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description juzhang 2010-07-15 05:44:41 EDT
Description of problem:
"device_add" command accept it without emitting any message when  pass-through a usb device to guest with a wrong busid:addrid.

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


How reproducible:


Steps to Reproduce:
1.list usb device in host
#lsusb 
Bus 008 Device 003: ID 0557:2213 ATEN International Co., Ltd 
Bus 008 Device 002: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 090c:1000 Feiya Technology Corp. Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.boot guest
#/usr/libexec/qemu-kvm -m 2G -smp 2 -drive file=/root/zhangjunyi/rhel6.64.qcow2,if=none,id=test,boot=on,cache=none,format=qcow2 -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -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 -device piix3-usb-uhci,id=piix3test


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

4.Issue an obviously wrong usb-host hostaddr,vendorid and productid.because all not in step 1 list
#{"execute":"device_add","arguments":{"driver":"usb-host","hostbus":"001","hostaddr":"1000","vendorid":"aaa","productid":"aaa","id":"usbtest3"}}
{"return": {}}

5. check usbhost
(qemu) info usbhost 
  Device 1.1, speed 480 Mb/s
    Hub: USB device 1d6b:0002, EHCI Host Controller
  Device 2.1, speed 480 Mb/s
    Hub: USB device 1d6b:0002, EHCI Host Controller
  Device 3.1, speed 12 Mb/s
    Hub: USB device 1d6b:0001, UHCI Host Controller
  Device 4.1, speed 12 Mb/s
    Hub: USB device 1d6b:0001, UHCI Host Controller
  Device 8.1, speed 12 Mb/s
    Hub: USB device 1d6b:0001, UHCI Host Controller
  Device 8.2, speed 12 Mb/s
    Hub: USB device 0557:7000
  Device 8.3, speed 1.5 Mb/s
    Class 00: USB device 0557:2213, CS-1734A V4.2.411
  Device 1.3, speed 480 Mb/s
    Class 00: USB device 090c:1000, USB DISK
  Auto filters:
    Device 1.1000 ID 0aaa:0aaa

Actual results:
after step 4,Usb-host was added. 

Expected results:
When hot add usb-host using device_add command,device_add command should check their property whether valid. 

Additional info:
when  tested using wrong hostbus(first property),
Comment 1 juzhang 2010-07-15 05:47:02 EDT
please ignore comment0  "Additional info:when  tested using wrong hostbus(first property)"
Comment 3 RHEL Product and Program Management 2010-07-15 10:17:13 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 4 Gerd Hoffmann 2010-08-02 05:09:18 EDT
This works as designed.  usb-host does *not* require usb devices being present.

usb-host will recognize plug and unplug events on the host and pass them though to the guest.  You can plugin and -out the host device passed through to the guest as you like.  Try this:

(1) plug-in your usb device on the host
(2) note vendor and device id
(3) plug-out your usb device
(4) device_add usb-host with the IDs noted in step #2.
(5) plug-in your usb device
(6) watch the device show up in the guest.
(7) plug-out your usb device
(8) watch the device go away in the guest.
(9) if you enjoyed it, continue with step #5 ;)

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