You are not logged in.

#1 2013-07-22 14:00:11

DrMikeDuke
Member
From: Australia
Registered: 2008-05-12
Posts: 79
Website

qemu/kvm: multiple USB devices from the same vendor

Hi fellow gurus,

Trying to pass-through two USB devices. One works just fine, but two produces an error.
They are the same type from the same vendor and libvirt seems to have no way to differentiate between the two, as it only uses the <vendor id='0xnnnn'/> & <product id='0xnnn'/> strings and not serial number of the device.

There is a reference -unanswered- here: https://bugs.launchpad.net/qemu/+bug/1090602

The error message from virt-manager:

Error starting domain: operation failed: Multiple USB devices for 10c4:ea60, use <address> to specify one

Detailed output

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1063, in startup
    self._backend.create()
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 678, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: operation failed: Multiple USB devices for 10c4:ea60, use <address> to specify one

The devices themselves:

Bus 001 Device 009: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 001 Device 008: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

Is there any workaround or fix for this?


Cheers,

Mike.

Last edited by DrMikeDuke (2013-07-22 14:01:18)


Workstation: Core i7 2600k | Asus PBZ68-V/GEN3 | 8GB DDR3-2000 | Gainward GLH GTX570 | Velociraptor 300 | AntecSS 850W | Essence ST | Corsair 800D | Win7x64 Pro/Arch LinuxX64
Server: 2x Six-Core AMD Opteron Processor 8439 SE, 64GB DDR2 ECC, Tyan S2932-SI, Areca ARC-1230 Raid, PCP&C 1Kw PSU, LSi FusionMPT Ultra320 SCSI/Tandberg LTO4 Autoloader
Laptop: Alienware M14xR3

Offline

#2 2013-07-22 16:02:44

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: qemu/kvm: multiple USB devices from the same vendor

Have you tried specifying them using 'bus.device'? See section 3.10.1 of your qemu docs (/usr/share/doc/qemu/qemu-doc.html).


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2013-07-22 16:19:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: qemu/kvm: multiple USB devices from the same vendor

alphaniner wrote:

Have you tried specifying them using 'bus.device'? See section 3.10.1 of your qemu docs (/usr/share/doc/qemu/qemu-doc.html).

In the last release, the docs were forgotten in the package.  So you are going to have to look this up online.

@OP, I am not too familiar with libvirt, but alphaniner is telling you that you need to specify whether it is USB 001:008 or 001:009.

Last edited by WonderWoofy (2013-07-22 16:23:57)

Offline

#4 2013-07-22 16:30:17

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: qemu/kvm: multiple USB devices from the same vendor

If it's not possible to do this through libvirt, you can use the monitor command usb_add:

usb_add host:<bus>.<device>

But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2013-07-23 02:07:41

DrMikeDuke
Member
From: Australia
Registered: 2008-05-12
Posts: 79
Website

Re: qemu/kvm: multiple USB devices from the same vendor

Hi guys,

Thanks for the advice. I consulted the doco at http://qemu.weilnetz.de/qemu-doc.html#usb_005fdevices

host:bus.addr
Pass through the host device identified by bus.addr (Linux only)
host:vendor_id:product_id

Not sure if there's something like a <device id> like field I can put with vendor id and product id?

I also tried using `usb_add` but it doesn't seem to be included in the virsh shell (or am I looking in the wrong place?:))


Cheers.


Workstation: Core i7 2600k | Asus PBZ68-V/GEN3 | 8GB DDR3-2000 | Gainward GLH GTX570 | Velociraptor 300 | AntecSS 850W | Essence ST | Corsair 800D | Win7x64 Pro/Arch LinuxX64
Server: 2x Six-Core AMD Opteron Processor 8439 SE, 64GB DDR2 ECC, Tyan S2932-SI, Areca ARC-1230 Raid, PCP&C 1Kw PSU, LSi FusionMPT Ultra320 SCSI/Tandberg LTO4 Autoloader
Laptop: Alienware M14xR3

Offline

#6 2013-07-23 13:06:53

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: qemu/kvm: multiple USB devices from the same vendor

As I understand it, host:bus.addr is an alternative to host:vendor_id:product_id. So if I wanted to pass both of these thumb drives:

$ lsusb
Bus 001 Device 002: ID 1e3d:2093 Chipsbank Microelectronics Co., Ltd CBM209x Flash Drive (OEM)
Bus 001 Device 003: ID 1e3d:2093 Chipsbank Microelectronics Co., Ltd CBM209x Flash Drive (OEM)
...

I would use host:001.002 and host:001.003 . Note I said would use, because I've never tried it.

And usb_add is a qemu monitor command. See sections 3.4 and 3.5 of the doc you linked for info on the monitor.

All this being said, I don't use libvirt stuff so I don't know if it has the capability to specify USB devices by bus.addr or whether or not it enables the monitor.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2013-07-24 05:34:30

DrMikeDuke
Member
From: Australia
Registered: 2008-05-12
Posts: 79
Website

Re: qemu/kvm: multiple USB devices from the same vendor

Thanks for the clarification.
I'm afraid I've been a bit spoiled by the virt-manager so it's only now I'm getting in to the nitty-gritty smile


Regards,

M.


Workstation: Core i7 2600k | Asus PBZ68-V/GEN3 | 8GB DDR3-2000 | Gainward GLH GTX570 | Velociraptor 300 | AntecSS 850W | Essence ST | Corsair 800D | Win7x64 Pro/Arch LinuxX64
Server: 2x Six-Core AMD Opteron Processor 8439 SE, 64GB DDR2 ECC, Tyan S2932-SI, Areca ARC-1230 Raid, PCP&C 1Kw PSU, LSi FusionMPT Ultra320 SCSI/Tandberg LTO4 Autoloader
Laptop: Alienware M14xR3

Offline

#8 2013-07-24 13:08:57

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: qemu/kvm: multiple USB devices from the same vendor

NP. I got a distaste for virt-manager after trying to use it with a remote Xen machine. TBH I don't even remember if I tried it with qemu/kvm, I just wrote a script to launch VMs based on manually created config files.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB