aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-27 15:18:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-27 15:40:53 +0100
commit3741715cf2e54727fe3d9884ea6dcea68c7f7d4b (patch)
tree99dfc7e4ca9c85e5fd3ace161b125169ae4c87e8 /vl.c
parente64722108c1342d499d408c386ce65794c44dd63 (diff)
downloadqemu-3741715cf2e54727fe3d9884ea6dcea68c7f7d4b.zip
qemu-3741715cf2e54727fe3d9884ea6dcea68c7f7d4b.tar.gz
qemu-3741715cf2e54727fe3d9884ea6dcea68c7f7d4b.tar.bz2
usb: Resolve warnings about unassigned bus on usb device creation
When creating an USB device the old way, there is no way to specify the target bus. Thus the warning issued by usb_create makes no sense and rather confuses our users. Resolve this by passing a bus reference to the usbdevice_init handler and letting those handlers forward it to usb_create. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 1d4c350..4a77696 100644
--- a/vl.c
+++ b/vl.c
@@ -1052,12 +1052,13 @@ static int usb_device_add(const char *devname)
#ifndef CONFIG_LINUX
/* only the linux version is qdev-ified, usb-bsd still needs this */
if (strstart(devname, "host:", &p)) {
- dev = usb_host_device_open(p);
+ dev = usb_host_device_open(usb_bus_find(-1), p);
} else
#endif
if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
- dev = usb_bt_init(devname[2] ? hci_init(p) :
- bt_new_hci(qemu_find_bt_vlan(0)));
+ dev = usb_bt_init(usb_bus_find(-1),
+ devname[2] ? hci_init(p)
+ : bt_new_hci(qemu_find_bt_vlan(0)));
} else {
return -1;
}