USB redirection flow on Windows includes a number of reset requests issued
to the port that hosts the device deing redirected.
Each port reset emulates device removal and reinsertion and produces
corresponding hotplug events and a number of device list updates on
different levels of USB stack and USB redirection engine.
As a result, queriyng USB device list performed by spice-gtk's hotplug
event handler may return inconsistent results if performed in parallel
to redirection flow.
This patch suppresses handling of USB hotplug events during redirection
and injects a simulated hotplug event after redirection completion
in order to properly process real device list changes in case they
happened during the redirection flow.
Signed-off-by: Kirill Moizik <kmoizik@redhat.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit introduces redirecting property of GUdevClient
This property indicates when a redirection operation
is in progress on a device. It's set back to FALSE
once the device is fully redirected to the guest.
Signed-off-by: Kirill Moizik <kmoizik@redhat.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This patch fixes device list change notification handing
logic for cases when more than one device being plugged
or unplugged simultaneously.
The simplest way to reproduce the problematic scenario
is (un)plugging of a usb HUB with a few devices inserted.
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>