qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH 1/3] usb-linux: Store devpath into USBHostDe


From: Hans de Goede
Subject: Re: [Qemu-devel] Re: [PATCH 1/3] usb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS
Date: Wed, 10 Nov 2010 09:46:21 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Lightning/1.0b2 Thunderbird/3.1.6

Hi,

On 11/09/2010 09:43 PM, Yuriy Kaminskiy wrote:
Hans de Goede wrote:
This allows us to recreate the sysfspath used during scanning later
(which will be used in a later patch in this series).
---
  usb-linux.c |   29 +++++++++++++++++++----------
  1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index c3c38ec..61e8ec6 100644
--- a/usb-linux.c
+++ b/usb-linux.c
[...]
@@ -1300,6 +1302,13 @@ static int usb_host_scan_sys(void *opaque, USBScanFunc 
*func)
              if (sscanf(line, "%d",&addr) != 1) {
                  goto the_end;
              }
+            if (!usb_host_read_file(line, sizeof(line), "devpath",
+                                    de->d_name)) {
+                goto the_end;
+            }

FYI: "devpath" attribute was introduced in 2.6.33 kernel.


Ah I did not know that, well the same information is available in de->d_name, 
and has
been so for much longer. So I'll do a new version getting it from de->d_name 
instead.

Thanks,

Hans



reply via email to

[Prev in Thread] Current Thread [Next in Thread]