[Spice-devel] [spice-gtk 2/5] usb-redir: unify device hotplug/unplug for Windows and Linux

2019-07-14 Thread Yuri Benditovich
Remove Windows-specific part of hotplug detection from usb-device-manager and win-usb-dev and place it into USB backend module. Connect the hotplug/unplug detection in Windows to the same callbacks already used in Linux. This removes significant part of Windows-specific code and simpifies things. N

[Spice-devel] [spice-gtk 4/5] usb-redir: delete usb-backend context on initialization error

2019-07-14 Thread Yuri Benditovich
The delete in error flow was missing. Signed-off-by: Yuri Benditovich --- src/usb-device-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 857d057..7105ff1 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @

[Spice-devel] [spice-gtk 1/5] build: require minimal libusb version 1.0.21

2019-07-14 Thread Yuri Benditovich
Previous commit ca641a5b92 uses libusb_interrupt_event_handler which requires newer version of libusb. Signed-off-by: Yuri Benditovich --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 32561ee..54160f9 100644 --- a/meson.build +++

[Spice-devel] [spice-gtk 0/5] usb-redir: unification of Linux and Windows code

2019-07-14 Thread Yuri Benditovich
This series is dedicated to unification of Linux Windows flows in usb-device-manager. It moves differences related to libusb to USB backend module and simplifies implementation of procedure related to USB redirection. Yuri Benditovich (5): build: require minimal libusb version 1.0.21 usb-redir

[Spice-devel] [spice-gtk 5/5] usb-redir: move USB events handling to USB backend

2019-07-14 Thread Yuri Benditovich
Before this commit: usb-device-manager starts thread for handling libusb events. On Linux - from the beginning (as it is needed for hotplug callbacks) On Windows - starts it on first redirection and stops when there are no redirections (it can't keep the thread when there are no redirecti

[Spice-devel] [spice-gtk 3/5] usb-redir: pass GError to hotplug registration procedure

2019-07-14 Thread Yuri Benditovich
In case of possible error the procedure of hotplug registration does not return error information, just issues warning to the stderr, so the reason of the problem, if any, is not visible. Current commit adds GError parameter to the procedure to return the error details conventionally. Signed-off-b