All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del
@ 2015-06-04  7:55 Lin Ma
  2015-06-16 13:31 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Lin Ma @ 2015-06-04  7:55 UTC (permalink / raw)
  To: qemu-devel, kraxel; +Cc: Lin Ma

Without usb=on machine option, usb_device_add/usb_device_del don't work,
Even if there are virtual usb controllers presented.

This patch fixes it.

Signed-off-by: Lin Ma <lma@suse.com>
---
 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 1d4c089..26fab83 100644
--- a/vl.c
+++ b/vl.c
@@ -1234,7 +1234,7 @@ static int usb_device_add(const char *devname)
     const char *p;
 #endif
 
-    if (!usb_enabled()) {
+    if (!usb_bus_find(-1)) {
         return -1;
     }
 
@@ -1266,7 +1266,7 @@ static int usb_device_del(const char *devname)
         return -1;
     }
 
-    if (!usb_enabled()) {
+    if (!usb_bus_find(-1)) {
         return -1;
     }
 
-- 
2.1.4

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

* Re: [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del
  2015-06-04  7:55 [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del Lin Ma
@ 2015-06-16 13:31 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2015-06-16 13:31 UTC (permalink / raw)
  To: Lin Ma; +Cc: qemu-devel

On Do, 2015-06-04 at 15:55 +0800, Lin Ma wrote:
> Without usb=on machine option, usb_device_add/usb_device_del don't work,
> Even if there are virtual usb controllers presented.

If you use -device to add your usb host controllers, you should likewise
use -device (or device_add monitor cmd) to add your usb devices.

-usbdevice is legacy syntax and only there for backward compatibility.

cheers,
  Gerd

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

end of thread, other threads:[~2015-06-16 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04  7:55 [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del Lin Ma
2015-06-16 13:31 ` 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.