qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Broken USB support for Linux host
@ 2008-10-19 18:00 Bjorn Danielsson
  2008-10-21 13:39 ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Danielsson @ 2008-10-19 18:00 UTC (permalink / raw)
  To: qemu-devel

Hello everyone, this is a bug report with a suggested patch included.

Summary: usb_host_scan() in usb-linux.c doesn't handle the logic
correctly when looking for different places to find bus/usb/devices.

Environment: qemu revision 5499 on slamd64 (slackware) 12.1

Symptom: no "host:" usb devices are available at all on any system
where /proc/bus/usb/devices exists.

Diagnosis: the else clause for the USB_FS_SYS case is wrong.

Solution:

---cut-here--------------
Index: usb-linux.c
===================================================================
--- usb-linux.c	(revision 5499)
+++ usb-linux.c	(working copy)
@@ -1293,7 +1293,8 @@
             usb_fs_type = USB_FS_SYS;
             closedir(dir);
             dprintf(opened, USBSYSBUS_PATH, devices);
-        } else {
+        }
+        if (!usb_fs_type) {
             term_printf("husb: unable to access USB devices\n");
             goto the_end;
         }

---cut-here--------------

-- 
Bjorn Danielsson  <bdq@dax.nu>

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

* Re: [Qemu-devel] Broken USB support for Linux host
  2008-10-19 18:00 [Qemu-devel] Broken USB support for Linux host Bjorn Danielsson
@ 2008-10-21 13:39 ` Anthony Liguori
  2008-10-21 14:50   ` [Qemu-devel] [PATCH] Fix broken " Bjorn Danielsson
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2008-10-21 13:39 UTC (permalink / raw)
  To: qemu-devel

Bjorn Danielsson wrote:
> Hello everyone, this is a bug report with a suggested patch included.
>
> Summary: usb_host_scan() in usb-linux.c doesn't handle the logic
> correctly when looking for different places to find bus/usb/devices.
>
> Environment: qemu revision 5499 on slamd64 (slackware) 12.1
>
> Symptom: no "host:" usb devices are available at all on any system
> where /proc/bus/usb/devices exists.
>
> Diagnosis: the else clause for the USB_FS_SYS case is wrong.
>   

Thanks for narrowing this down.

Please include a Signed-off-by so we can include your patch.

Regards,

Anthony Liguori

> Solution:
>
> ---cut-here--------------
> Index: usb-linux.c
> ===================================================================
> --- usb-linux.c	(revision 5499)
> +++ usb-linux.c	(working copy)
> @@ -1293,7 +1293,8 @@
>              usb_fs_type = USB_FS_SYS;
>              closedir(dir);
>              dprintf(opened, USBSYSBUS_PATH, devices);
> -        } else {
> +        }
> +        if (!usb_fs_type) {
>              term_printf("husb: unable to access USB devices\n");
>              goto the_end;
>          }
>
> ---cut-here--------------
>
>   

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

* [Qemu-devel] [PATCH] Fix broken USB support for Linux host
  2008-10-21 13:39 ` Anthony Liguori
@ 2008-10-21 14:50   ` Bjorn Danielsson
  2008-10-21 15:53     ` Bjorn Danielsson
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Danielsson @ 2008-10-21 14:50 UTC (permalink / raw)
  To: qemu-devel

Make "host:" usb devices work again on systems that have the
file /proc/bus/usb/devices. This was broken in r5441 due to
incorrect logic for the USB_FS_SYS case in usb_host_scan().

Signed-off by: Bjorn Danielsson <bdq@dax.nu>

Index: usb-linux.c
===================================================================
--- usb-linux.c	(revision 5499)
+++ usb-linux.c	(working copy)
@@ -1293,7 +1293,8 @@
             usb_fs_type = USB_FS_SYS;
             closedir(dir);
             dprintf(opened, USBSYSBUS_PATH, devices);
-        } else {
+        }
+        if (!usb_fs_type) {
             term_printf("husb: unable to access USB devices\n");
             goto the_end;
         }

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

* Re: [Qemu-devel] [PATCH] Fix broken USB support for Linux host
  2008-10-21 14:50   ` [Qemu-devel] [PATCH] Fix broken " Bjorn Danielsson
@ 2008-10-21 15:53     ` Bjorn Danielsson
  2008-10-21 16:17       ` Bjorn Danielsson
  2008-10-21 16:34       ` Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Bjorn Danielsson @ 2008-10-21 15:53 UTC (permalink / raw)
  To: qemu-devel

Make "host:" usb devices work again on systems that have the
file /proc/bus/usb/devices. This was broken in r5441 due to
incorrect logic for the USB_FS_SYS case in usb_host_scan().

Signed-off-by: Bjorn Danielsson <bdq@dax.nu>

Index: usb-linux.c
===================================================================
--- usb-linux.c	(revision 5499)
+++ usb-linux.c	(working copy)
@@ -1293,7 +1293,8 @@
             usb_fs_type = USB_FS_SYS;
             closedir(dir);
             dprintf(opened, USBSYSBUS_PATH, devices);
-        } else {
+        }
+        if (!usb_fs_type) {
             term_printf("husb: unable to access USB devices\n");
             goto the_end;
         }

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

* Re: [Qemu-devel] [PATCH] Fix broken USB support for Linux host
  2008-10-21 15:53     ` Bjorn Danielsson
@ 2008-10-21 16:17       ` Bjorn Danielsson
  2008-10-21 16:34       ` Anthony Liguori
  1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Danielsson @ 2008-10-21 16:17 UTC (permalink / raw)
  To: qemu-devel

Sorry for the multiple posts, I'm not used to the linux-style
patching protocol. I hope I got it right in the last post.

-- 
Bjorn Danielsson  <bdq@dax.nu>

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

* Re: [Qemu-devel] [PATCH] Fix broken USB support for Linux host
  2008-10-21 15:53     ` Bjorn Danielsson
  2008-10-21 16:17       ` Bjorn Danielsson
@ 2008-10-21 16:34       ` Anthony Liguori
  1 sibling, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2008-10-21 16:34 UTC (permalink / raw)
  To: qemu-devel

Bjorn Danielsson wrote:
> Make "host:" usb devices work again on systems that have the
> file /proc/bus/usb/devices. This was broken in r5441 due to
> incorrect logic for the USB_FS_SYS case in usb_host_scan().
>
> Signed-off-by: Bjorn Danielsson <bdq@dax.nu>
>   

Applied.  Thanks.

Regards,

Anthony Liguori

> Index: usb-linux.c
> ===================================================================
> --- usb-linux.c	(revision 5499)
> +++ usb-linux.c	(working copy)
> @@ -1293,7 +1293,8 @@
>              usb_fs_type = USB_FS_SYS;
>              closedir(dir);
>              dprintf(opened, USBSYSBUS_PATH, devices);
> -        } else {
> +        }
> +        if (!usb_fs_type) {
>              term_printf("husb: unable to access USB devices\n");
>              goto the_end;
>          }
>
>
>   

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

end of thread, other threads:[~2008-10-21 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-19 18:00 [Qemu-devel] Broken USB support for Linux host Bjorn Danielsson
2008-10-21 13:39 ` Anthony Liguori
2008-10-21 14:50   ` [Qemu-devel] [PATCH] Fix broken " Bjorn Danielsson
2008-10-21 15:53     ` Bjorn Danielsson
2008-10-21 16:17       ` Bjorn Danielsson
2008-10-21 16:34       ` Anthony Liguori

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).