qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lei Li <lilei@linux.vnet.ibm.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM
Date: Wed, 16 Jan 2013 15:18:23 +0800	[thread overview]
Message-ID: <50F6543F.4060502@linux.vnet.ibm.com> (raw)

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

             reply	other threads:[~2013-01-16  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16  7:18 Lei Li [this message]
2013-01-16  7:56 ` [Qemu-devel] [RFC] Add serial number to usbdevice when passthrough to VM Gerd Hoffmann
2013-01-17  4:45   ` Lei Li
2013-01-17  8:34     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F6543F.4060502@linux.vnet.ibm.com \
    --to=lilei@linux.vnet.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).