From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwDuQ-0007EA-0n for qemu-devel@nongnu.org; Mon, 29 Mar 2010 08:17:34 -0400 Received: from [140.186.70.92] (port=50676 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwDuO-0007E2-W0 for qemu-devel@nongnu.org; Mon, 29 Mar 2010 08:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwDuN-00080U-Gn for qemu-devel@nongnu.org; Mon, 29 Mar 2010 08:17:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57448) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwDuN-00080K-7K for qemu-devel@nongnu.org; Mon, 29 Mar 2010 08:17:31 -0400 Message-ID: <4BB09A2D.20006@redhat.com> Date: Mon, 29 Mar 2010 14:16:45 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] usb-bus: fix no params References: <20100327124756.GI15194@volta.aurel32.net> In-Reply-To: <20100327124756.GI15194@volta.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: TeLeMan , qemu-devel Am 27.03.2010 13:47, schrieb Aurelien Jarno: > On Fri, Mar 19, 2010 at 12:59:24PM +0800, TeLeMan wrote: >> The "params" is never NULL and the usb hid devices have no params. > > This looks plainly wrong. With your patch, usb devices which don't > accept parameters, will accept and ignore them. > > What are you trying to fix here? It looks like it's fixing -usbdevice tablet (and keyboard/mouse) which currently fails like this: qemu-system-x86_64: usbdevice tablet accepts no params qemu: could not add USB device 'tablet' He's correct in that params is never NULL (if it was NULL it's set to an empty string some lines earlier, introduced by 702f3e0f), so usb_create_simple is never called. Maybe the right fix is to check for *params instead of params now? Kevin > >> Signed-off-by: TeLeMan >> --- >> hw/usb-bus.c | 4 ---- >> 1 files changed, 0 insertions(+), 4 deletions(-) >> >> diff --git a/hw/usb-bus.c b/hw/usb-bus.c >> index ce8a694..f3f1ed6 100644 >> --- a/hw/usb-bus.c >> +++ b/hw/usb-bus.c >> @@ -299,10 +299,6 @@ USBDevice *usbdevice_create(const char *cmdline) >> } >> >> if (!usb->usbdevice_init) { >> - if (params) { >> - error_report("usbdevice %s accepts no params", driver); >> - return NULL; >> - } >> return usb_create_simple(bus, usb->qdev.name); >> } >> return usb->usbdevice_init(params); >> -- >> 1.6.5.1.1367.gcd48 >> -- >> SUN OF A BEACH >> >> >> >