usb-bus: fix no params
PATCH 1/1 usb-bus: fix no params
The "params" is never NULL and the usb hid devices have no params.
--- hw/usb-bus.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
hw/usb-bus.c +0 -4
@@ -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);
Signature · 3 lines
1.6.5.1.1367.gcd48 -- SUN OF A BEACH
Quoted 1 line · TeLeMan
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?
Quoted 27 lines
Signed-off-by TeLeMan <[email protected]>--- hw/usb-bus.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)hw/usb-bus.c +0
-4@@ -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);Signature · 3 lines
1.6.5.1.1367.gcd48 -- SUN OF A BEACH
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
Am 27.03.2010 13:47, schrieb Aurelien Jarno:
Quoted 7 lines · TeLeMan
Quoted 1 line
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
Quoted 29 lines
Quoted 28 lines
Signed-off-by TeLeMan <[email protected]>--- hw/usb-bus.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)hw/usb-bus.c +0
-4@@ -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);Signature · 3 lines
1.6.5.1.1367.gcd48 -- SUN OF A BEACH
Quoted 12 lines · Kevin Wolf
Am 27.03.2010 13:47, schrieb Aurelien Jarno:
Quoted 7 lines · TeLeMan
Quoted 1 line
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:
Quoted 7 lines
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), sousb_create_simpleis 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.