Thanks. I get it now.<br><br><div class="gmail_quote">2012/7/29 Hans de Goede <span dir="ltr"><<a href="mailto:hdegoede@redhat.com" target="_blank">hdegoede@redhat.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div class="im"><br>
<br>
On 07/25/2012 03:36 PM, flooding Controlled wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi:<br>
    I am puzzled by some functions calling in the function : "spice_usb_device_manager_<u></u>initable_init"<br>
<br>
At this block:<br>
  /* Do coldplug (detection of already connected devices) */<br>
     libusb_get_device_list(priv-><u></u>context, &priv->coldplug_list);<br>
     list = g_udev_client_query_by_<u></u>subsystem(priv->udev, "usb");<br>
...<br>
...<br>
     libusb_free_device_list(priv-><u></u>coldplug_list, 1);<br>
     priv->coldplug_list = NULL;<br>
<br>
My questions are as follows:<br>
1. Well, it seems that there are two routines to gather information of the  already connected devices :<br>
"libusb_get_device_list" and " g_udev_client_query_by_<u></u>subsystem " ,  which is the really for wok one ?<br>
"g_udev_client_query_by_<u></u>subsystem" seems to be , am I right ?<br>
</blockquote>
<br></div>
g_udev gives us a list of USB devices present in the system, and not much more then that, where as we<br>
use libusb for low level device access, so we manage usb devices through a list of libusb_device references,<br>
the only reason we're also using gusb is because it gives us dynamic notification when device get plugged<br>
in / removed.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2. So, the second question is, why we gather info to "priv->coldplug_list", as the codes above, it just be freed, and has never been used!<br>
</blockquote>
<br></div>
That is not true, the coldplug_list gets used in spice_usb_device_manager_add_<u></u>dev to not have to<br>
call libusb_get_device_list repeatedly when enumerating devices already plugged in on spice-gtk<br>
startup.<br>
<br>
Regards,<br>
<br>
Hans<br>
</blockquote></div><br>