All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Lin Ma <lma@suse.com>
To: qemu-devel@nongnu.org, kraxel@redhat.com
Cc: Lin Ma <lma@suse.com>
Subject: [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del
Date: Thu,  4 Jun 2015 15:55:34 +0800	[thread overview]
Message-ID: <1433404534-12003-1-git-send-email-lma@suse.com> (raw)

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

             reply	other threads:[~2015-06-04  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  7:55 Lin Ma [this message]
2015-06-16 13:31 ` [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del 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=1433404534-12003-1-git-send-email-lma@suse.com \
    --to=lma@suse.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 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.