VM fails to start with host USB device attached when multiple identical Vendor:Product IDs exist
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/
callback(
File "/usr/share/
callback(*args, **kwargs)
File "/usr/share/
self.
File "/usr/lib/
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: operation failed: Multiple USB devices for 8564:1000, use <address> to specify one
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 ---