From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Q0u-0007lw-QR for qemu-devel@nongnu.org; Thu, 04 Jun 2015 03:56:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Q0q-00063H-Pq for qemu-devel@nongnu.org; Thu, 04 Jun 2015 03:56:32 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:60415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Q0q-0005ut-JX for qemu-devel@nongnu.org; Thu, 04 Jun 2015 03:56:28 -0400 From: Lin Ma Date: Thu, 4 Jun 2015 15:55:34 +0800 Message-Id: <1433404534-12003-1-git-send-email-lma@suse.com> Subject: [Qemu-devel] [PATCH] usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com 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 --- 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