All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] USB port NULL pointer causes segv
@ 2011-08-18 11:50 erik.rull
  0 siblings, 0 replies; 4+ messages in thread
From: erik.rull @ 2011-08-18 11:50 UTC (permalink / raw)
  To: qemu-devel

Hi Gerd,

thanks a lot.

I just had a look on usb-linux.c where the "port" could be identified.

for those that must use /proc/bus/usb it would be possible to allow the
following:
read in the "Port=" and check if it is on bus level 1, then you can
identify at least your real root hardware port - hubs won't work, but for
most users this would help at least for basic use cases.

And:
My system has the /sys/bus/usb structure, but NO udev enabled! That means
the /dev/bus/usb structure is missing! Running the existing usb-linux.c
code, I can never use USB, because /sys/... is selected but /dev/... is
used which is not checked for existance! This causes delayed problems when
you want to start using usb host devices.
I moved the /proc/bus/usb checking in front of the /sys/ checking and it
worked for me - maybe not useful for all but then the checkings for
/sys/bus/usb should be extended on the /dev/bus/usb existance check.

Additionally I have bigger problems with CD and DVD usb drives, they get
detected and routed to the guest, but the "claimend" message comes up on
the qemu monitor every 10-15 seconds and sometimes the linux usb driver
resets the port - that causes a very slow detection in the guest and I
never got it finished and I was not able to access the data on the CD. Most
USB keys work, but some also had a similar issue.

Everything tested with qemu-kvm-0.15.0

Best regards,

Erik

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [Qemu-devel] USB port NULL pointer causes segv
@ 2011-08-21 15:29 Erik Rull
  0 siblings, 0 replies; 4+ messages in thread
From: Erik Rull @ 2011-08-21 15:29 UTC (permalink / raw)
  To: qemu-devel

Hi Gerd,

thanks a lot.

I just had a look on usb-linux.c where the "port" could be identified.

for those that must use /proc/bus/usb it would be possible to allow the
following:
read in the "Port=" and check if it is on bus level 1, then you can
identify at least your real root hardware port - hubs won't work, but for
most users this would help at least for basic use cases.

And:
My system has the /sys/bus/usb structure, but NO udev enabled! That means
the /dev/bus/usb structure is missing! Running the existing usb-linux.c
code, I can never use USB, because /sys/... is selected but /dev/... is
used which is not checked for existance! This causes delayed problems when
you want to start using usb host devices.
I moved the /proc/bus/usb checking in front of the /sys/ checking and it
worked for me - maybe not useful for all but then the checkings for
/sys/bus/usb should be extended on the /dev/bus/usb existance check.

Additionally I have bigger problems with CD and DVD usb drives, they get
detected and routed to the guest, but the "claimend" message comes up on
the qemu monitor every 10-15 seconds and sometimes the linux usb driver
resets the port - that causes a very slow detection in the guest and I
never got it finished and I was not able to access the data on the CD. Most
USB keys work, but some also had a similar issue.

Everything tested with qemu-kvm-0.15.0

Best regards,

Erik

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Qemu-devel] USB port NULL pointer causes segv
@ 2011-08-17 16:24 Erik Rull
  2011-08-17 21:43 ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Rull @ 2011-08-17 16:24 UTC (permalink / raw)
  To: qemu-devel

Hi all,

in usb-linux.c my qemu crashes in
static int usb_host_open(USBHostDevice *dev, int bus_num, int addr, char 
*port, const char *prod_name, int speed)

because port is NULL.

The line that causes the problem is:
strcpy(dev->port, port);

All Ports are displayed in the qemu monitor info as (null)

when changing the line to:
     if (port)
       strcpy(dev->port, port);
     else
       dev->port[0] = '\0';

everything is fine :-)

Please check this issue and let me know if my workaround is okay.

Best regards,

Erik

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

end of thread, other threads:[~2011-08-21 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 11:50 [Qemu-devel] USB port NULL pointer causes segv erik.rull
  -- strict thread matches above, loose matches on Subject: below --
2011-08-21 15:29 Erik Rull
2011-08-17 16:24 Erik Rull
2011-08-17 21:43 ` Gerd Hoffmann

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.