Hide Forgot
Description of problem: After attaching a usb storage device from host to a guest, host /dev/sdX (assume this is the USB storage device), /dev/sdX disappeared correctly, and then detach it from guest, /dev/sdX should appear, but actually /dev/sdX didn't show up. Version-Release number of selected component (if applicable): 2.6.32-189.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.attach a USB storage device from host to a guest host# lsusb | grep host# ls /dev/sd* /dev/sda /dev/sdb1 /dev/sdb2 ---/dev/sdb is the USB device will be attached guest# ls /dev/sd* No such file or directory host# virsh attach-device 1 usb.xml Device attached successfully host# ls /dev/sd* /dev/sda guest# ls /dev/sd* /dev/sda /dev/sda1 ---/dev/sda is the attached USB device--- (USB device successfully attached to guest) 2.detach it host# virsh detach-device 1 usb.xml Device detached successfully guest# ls /dev/sd* No such file or directory ---/dev/sda is not here because we just detached it host#ls /dev/sd* /dev/sda ---/dev/sdb is missing which shouled be here Actual results: /dev/sdb missing Expected results: /dev/sdb appear after detach Additional info: Try with 3 combinations USB3 device on USB2 port, USB2 device on USB3 port, USB2 device on USB2 port.All of them have this issue. host# cat usb.xml <hostdev mode='subsystem' type='usb' managed='yes'> <source> <vendor id='0x0bc2' /> <product id='0x50a1' /> </source> </hostdev> vendor id and product id can be found by running lsusb
Looks like an userspace issue.
Libvirt hasn't well support USB2.0 now, and we have a bug to trace similar issues: https://bugzilla.redhat.com/show_bug.cgi?id=715590
In addition, please provide your libvirt version.
I take this as a similiar bug in hand (#BZ 736214).
(In reply to comment #4) > In addition, please provide your libvirt version. And your qemu-kvm version is also important, the following is a qemu-kvm known bug about usb: https://bugzilla.redhat.com/show_bug.cgi?id=733272 So you had better give libvirt and qemu-kvm version in here. Alex
(In reply to comment #6) > (In reply to comment #4) > > In addition, please provide your libvirt version. > > And your qemu-kvm version is also important, the following is a qemu-kvm known > bug about usb: > https://bugzilla.redhat.com/show_bug.cgi?id=733272 > > So you had better give libvirt and qemu-kvm version in here. > > Alex Hi, Alex, Sorry,I didn't record the original test environment. But I just test with libvirt-0.9.4-12.el6.x86_64 qemu-kvm-0.12.1.2-2.192.el6.x86_64 and this issue is still there.
This is a RFE for libvirt, we don't reattach the managed USB device to host if attaching fails/detaching succeeded/starting fails/destroy succeeded, just like what for PCI device.
This should be done as part of the USB work to support USB > 1.0. Closing as WONTFIX and this work will be rolled into that RFE.