qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb-bus: fix no params
@ 2010-03-19  4:59 TeLeMan
  2010-03-27 12:47 ` Aurelien Jarno
  0 siblings, 1 reply; 4+ messages in thread
From: TeLeMan @ 2010-03-19  4:59 UTC (permalink / raw)
  To: qemu-devel

The "params" is never NULL and the usb hid devices have no params.

Signed-off-by: TeLeMan <geleman@gmail.com>
---
 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

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

* Re: [Qemu-devel] [PATCH] usb-bus: fix no params
  2010-03-19  4:59 [Qemu-devel] [PATCH] usb-bus: fix no params TeLeMan
@ 2010-03-27 12:47 ` Aurelien Jarno
  2010-03-29 12:16   ` Kevin Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Aurelien Jarno @ 2010-03-27 12:47 UTC (permalink / raw)
  To: TeLeMan; +Cc: qemu-devel

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?

> Signed-off-by: TeLeMan <geleman@gmail.com>
> ---
>  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
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] [PATCH] usb-bus: fix no params
  2010-03-27 12:47 ` Aurelien Jarno
@ 2010-03-29 12:16   ` Kevin Wolf
  2010-03-30  1:35     ` TeLeMan
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2010-03-29 12:16 UTC (permalink / raw)
  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 <geleman@gmail.com>
>> ---
>>  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
>>
>>
>>
> 

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

* Re: [Qemu-devel] [PATCH] usb-bus: fix no params
  2010-03-29 12:16   ` Kevin Wolf
@ 2010-03-30  1:35     ` TeLeMan
  0 siblings, 0 replies; 4+ messages in thread
From: TeLeMan @ 2010-03-30  1:35 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Aurelien Jarno

On Mon, Mar 29, 2010 at 20:16, Kevin Wolf <kwolf@redhat.com> wrote:
> 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?
Yes, you are right. I did a new patch for it.

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

end of thread, other threads:[~2010-03-30  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19  4:59 [Qemu-devel] [PATCH] usb-bus: fix no params TeLeMan
2010-03-27 12:47 ` Aurelien Jarno
2010-03-29 12:16   ` Kevin Wolf
2010-03-30  1:35     ` TeLeMan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).