VM fails to start with host USB device attached when multiple identical Vendor:Product IDs exist

Bug #1489175 reported by TJ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

On Trusty 14.04 LTS, and possibly later releases too (yet to be be tested) QEMU/KVM USB Host Device pass-through fails when the host has multiple identical USB devices attached.

When using the GUI to choose a USB Host device those devices are listed to the user by their USB Bus position which is guaranteed to be unique for every device.

However, in the background the generated XML device fragment uses the Vendor:Product ID. The GUI interface also only lists the device by its Vendor:Product ID.. libvirt is perfectly capable of addressing a device by its bus position.

The GUI should give the user the option to specify the device by Address or ID.

When there are multiple identical devices attached this causes the Guest to fail to start, reporting:

Error starting domain: operation failed: Multiple USB devices for 8564:1000, use <address> to specify one

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 117, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1162, in startup
    self._backend.create()
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 866, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: operation failed: Multiple USB devices for 8564:1000, use <address> to specify one

Revision history for this message
TJ (tj) wrote :
Revision history for this message
TJ (tj) wrote :

I had to use "virsh edit <domain>" to manually add an <address> specifier thus:

$ virsh dumpxml Kubuntu14.04
--- 8-< snip ---
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x8564'/>
        <product id='0x1000'/>
        <address bus='2' device='7'/>
      </source>
      <alias name='hostdev0'/>
    </hostdev>
--- 8-< snip ---

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.