Bug 798838 - Some problems of USB hostplug/passthrough with product and vendor.
Some problems of USB hostplug/passthrough with product and vendor.
Status: CLOSED DUPLICATE of bug 808459
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
Unspecified Unspecified
high Severity medium
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
: Regression
Depends On:
  Show dependency treegraph
Reported: 2012-02-29 22:31 EST by yuping zhang
Modified: 2012-04-30 11:03 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-30 10:44:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description yuping zhang 2012-02-29 22:31:31 EST
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):

How reproducible:

Steps to Reproduce:

# virsh nodedev-dumpxml usb_2_1
  <capability type='usb_device'>
    <product id='0x1625'>DT 101 II</product>
    <vendor id='0x0951'>Kingston</vendor>

1.Start a guest.
2.Prepare a USB xml with product + vendor.
#cat hostdev-usb-product.xml 
<hostdev mode='subsystem' type='usb' managed='yes'>
              <product id='0x1625'/>
              <vendor id='0x0951'/>

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

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'>
              <product id='0x1625'/>
              <vendor id='0x0951'/>
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.
Comment 2 dyuan 2012-04-28 03:10:26 EDT
It should be regression caused by patch of bug 743671.
Comment 5 Michal Privoznik 2012-04-30 04:00:05 EDT

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.
Comment 6 Laine Stump 2012-04-30 10:42:45 EDT
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.

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