All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] set usb bus name by busno.
@ 2013-03-29  2:48 qiaochong
  2013-04-02 13:36 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: qiaochong @ 2013-03-29  2:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: qiaochong

So when we add several usb buses on system, we can add usb device on special usb bus by special usb bus name usb-bus.busno.

Signed-off-by: qiaochong <qiaochong@loongson.cn>
---
 hw/usb/bus.c | 4 +++-
 1 个文件被修改,插入 3 行(+),删除 1 行(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index e58cd9a..c31a17c 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -68,7 +68,9 @@ const VMStateDescription vmstate_usb_device = {
 
 void usb_bus_new(USBBus *bus, USBBusOps *ops, DeviceState *host)
 {
-    qbus_create_inplace(&bus->qbus, TYPE_USB_BUS, host, NULL);
+    char name[64];
+    snprintf(name, 64, TYPE_USB_BUS ".%d", next_usb_bus);
+    qbus_create_inplace(&bus->qbus, TYPE_USB_BUS, host, name);
     bus->ops = ops;
     bus->busnr = next_usb_bus++;
     bus->qbus.allow_hotplug = 1; /* Yes, we can */
-- 
1.7.3.2.6901.g682ce8b

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

* Re: [Qemu-devel] [PATCH] set usb bus name by busno.
  2013-03-29  2:48 [Qemu-devel] [PATCH] set usb bus name by busno qiaochong
@ 2013-04-02 13:36 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2013-04-02 13:36 UTC (permalink / raw)
  To: qiaochong; +Cc: qemu-devel

On 03/29/13 03:48, qiaochong wrote:
> So when we add several usb buses on system, we can add usb device on
> special usb bus by special usb bus name usb-bus.busno.

Just name your usb host adapters using id (i.e. -device usb-ehci,id=foo).
The usb bus name will be "${id}.0" then.

cheers,
  Gerd

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

end of thread, other threads:[~2013-04-02 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29  2:48 [Qemu-devel] [PATCH] set usb bus name by busno qiaochong
2013-04-02 13:36 ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.