qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM
@ 2013-01-16  7:18 Lei Li
  2013-01-16  7:56 ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Lei Li @ 2013-01-16  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Hi guys,

Currently we can passthrough the host USB device to the virtual
machine. This is done like:

–usbdevice  host:1234:5678, where 1234 is vendor id, 5678 is product
id.

But there is a problem. If there are two identical USB devices,
where the vendor id and the product id is the same. It's not possible
to direct one USB device to VM1 and the second USB device to VM2.

So i want make it possible to distingish those devices by adding a
third parameter, the Serial number of the USB device.


More backinfo as here:

https://bugs.launchpad.net/qemu/+bug/1090602
https://bugzilla.redhat.com/show_bug.cgi?id=640332

When i try to add hack as above and test it, I found that some USB
device don't have iSerial number, which appear as 0 (This value is
given in the "lsusb -v" as "iSerial" field in USB Descriptor), and
usb_host_scan may not get the right iSerial number based on the current
implement.

To solve this problem, I wonder should we support this Serial Number
although it might be zero, or should we add a serial number which is
generated in Qemu and unique within the virtual machine, we can use
physical location to generate such number for example. Please let me
know your suggestions and thoughts!


Thanks.

-- 
Lei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM
  2013-01-16  7:18 [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM Lei Li
@ 2013-01-16  7:56 ` Gerd Hoffmann
  2013-01-17  4:45   ` Lei Li
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2013-01-16  7:56 UTC (permalink / raw)
  To: Lei Li; +Cc: qemu-devel

On 01/16/13 08:18, Lei Li wrote:
> Hi guys,
> 
> Currently we can passthrough the host USB device to the virtual
> machine. This is done like:
> 
> –usbdevice  host:1234:5678, where 1234 is vendor id, 5678 is product
> id.
> 
> But there is a problem. If there are two identical USB devices,
> where the vendor id and the product id is the same. It's not possible
> to direct one USB device to VM1 and the second USB device to VM2.

You can assign devices by physical port.
See docs/usb2.txt

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM
  2013-01-16  7:56 ` Gerd Hoffmann
@ 2013-01-17  4:45   ` Lei Li
  2013-01-17  8:34     ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Lei Li @ 2013-01-17  4:45 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 01/16/2013 03:56 PM, Gerd Hoffmann wrote:
> On 01/16/13 08:18, Lei Li wrote:
>> Hi guys,
>>
>> Currently we can passthrough the host USB device to the virtual
>> machine. This is done like:
>>
>> –usbdevice  host:1234:5678, where 1234 is vendor id, 5678 is product
>> id.
>>
>> But there is a problem. If there are two identical USB devices,
>> where the vendor id and the product id is the same. It's not possible
>> to direct one USB device to VM1 and the second USB device to VM2.
> You can assign devices by physical port.
> See docs/usb2.txt

Yes, I have read this doc, I know it also support hostbus+hostport or
hostbus+hostaddr combinations.

But as the backinfo's request, should we extented the usbdevice parameter
like:

--usbdevice host:<vendor id>[:<product id>[:<serial number>]?

What happened if upper app try to passthough those identical USB devices
by vendorid+productid combination?

AFAIK, Virtualbox support to distingish those device by adding this
third parameter 'Serial Number' for vendorid+productid combination.
  

> cheers,
>    Gerd
>
>


-- 
Lei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM
  2013-01-17  4:45   ` Lei Li
@ 2013-01-17  8:34     ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2013-01-17  8:34 UTC (permalink / raw)
  To: Lei Li; +Cc: qemu-devel

  Hi,

> But as the backinfo's request, should we extented the usbdevice parameter
> like:
> 
> --usbdevice host:<vendor id>[:<product id>[:<serial number>]?

-usbdevice is legacy syntax and isn't going to be extended.

Adding an "serial" property to usb-host is an option though.
Patches are welcome.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-17  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16  7:18 [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM Lei Li
2013-01-16  7:56 ` Gerd Hoffmann
2013-01-17  4:45   ` Lei Li
2013-01-17  8:34     ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).