[Spice-devel] Usb redirection

Hans de Goede hdegoede at redhat.com
Tue Dec 18 03:49:36 PST 2012


Hi,

On 12/18/2012 04:05 AM, Jackson wrote:
> And there is anther question. In the function "static gpointer
> spice_usb_device_manager_usb_ev_thread()",
> I use libusb_handle_events(context) to
> handle events, but I only receive data from server through the function
> "usbredir_read_callback()".
> After 60 secs, the client send data to server through
> "usbredir_write_callback()", so I use "libusb_handle_events_timeout_completed()"
> instead of "libusb_handle_events(").
> And set the timeout, then it works. why?

That is weird. There are 2 possible explanations for that:

1) usbredir_handle_msg from gtk/channel-usbredir.c is not getting
called, this would mean that the usb_ev_thread is somehow
blocking the main thread ?

2) The usbredirhost_read_guest_data() call from usbredir_handle_msg
has a complete packet, and one which requires it to make some libusb
call which takes one of libusb's internal locks, and for some reason
the libusb_handle_events() call holds that lock while it is sleeping?

Which platform are you on and which version of libusb are you using?

Regards,

Hans


More information about the Spice-devel mailing list