Hide Forgot
Description of problem: Hostplug USB to a guest,then shutdown guest -> start guest,fail to hostplug USB to guest. Shutdown guest,passthrough USB to guest,then start guest -> shutdown guest,after that,fail to start guest again. Version-Release number of selected component (if applicable): libvirt-0.9.10-3.el6.x86_64 virt-manager-0.9.0-10.el6.x86_64 How reproducible: always Steps to Reproduce: # virsh nodedev-dumpxml usb_2_1 <device> <name>usb_2_1</name> <parent>usb_usb2</parent> <driver> <name>usb</name> </driver> <capability type='usb_device'> <bus>2</bus> <device>8</device> <product id='0x1625'>DT 101 II</product> <vendor id='0x0951'>Kingston</vendor> </capability> </device> Hotplug: 1.Start a guest. 2.Prepare a USB xml with product + vendor. #cat hostdev-usb-product.xml <hostdev mode='subsystem' type='usb' managed='yes'> <source> <product id='0x1625'/> <vendor id='0x0951'/> </source> </hostdev> 3.#virsh attach-device rhel6.2-new hostdev-usb-product.xml Device attached successfully 4.Shutdown guest,then start it. 5.Attach the USB device to gust again # virsh attach-device rhel6.2-new hostdev-usb-product.xml error: Failed to attach device from hostdev-usb-product.xml error: Requested operation is not valid: USB device 002:010 is in use by domain ;�m Passthrough: 1.Shutdown a guest. 2.Add the USB xml(product+vendor) to guest. #virsh edit rhel6.2-new ... <hostdev mode='subsystem' type='usb' managed='yes'> <source> <product id='0x1625'/> <vendor id='0x0951'/> </source> </hostdev> ... 3.Start the guest.Wait for the guest boot successfully,then shutdown it. 4.Start the guest again. # virsh start rhel6.2-new error: Failed to start domain rhel6.2-new error: Requested operation is not valid: USB device 002:010 is in use by domain Actual results: As above Expected results: 1.The usb can be hotplugged and the guest can be started successfully. 2.Restart libvirtd,the usb can works well. Additional info: The USB works well when hotplug/passthrough with bus and device.
It should be regression caused by patch of bug 743671.
dyuan, You're right. The first round of patch that tried to fix bug 743671 turned out to be incomplete. Therefore I've posted the second round. However, the have missed upstream freeze phase, so they will be picked up by next release (0.9.12); So I think we can close this one as a dup of bug 743671. Laine?
Yes, this bug is fixed by the patches listed in https://bugzilla.redhat.com/show_bug.cgi?id=743671#c9 . They had been delayed because the full impact of *not* having them wasn't realized. So, completely fixing that bug will cause this bug to go away.