[Spice-devel,spice-gtk] usb-device-manager: Do not hide devices on client if USB redirection disabled

Submitted by Yuri Benditovich on April 9, 2017, 3:16 p.m.

Details

Message ID 1491751005-15872-1-git-send-email-yuri.benditovich@daynix.com
State New
Headers show
Series "usb-device-manager: Do not hide devices on client if USB redirection disabled" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Yuri Benditovich April 9, 2017, 3:16 p.m.
https://bugzilla.redhat.com/show_bug.cgi?id=1431137
When auto sharing of USB devices is enabled in remote-viewer's configuration
file, Windows spice client hides connected USB devices on client machine even
if USB redirection is disabled by --spice-disable-usbredir.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 src/usb-device-manager.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 4d0b93d..fc17338 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1945,6 +1945,12 @@  void _usbdk_hider_update(SpiceUsbDeviceManager *manager)
         return;
     }
 
+    if (!spice_session_get_usbredir_enabled(priv->session)) {
+        SPICE_DEBUG("Usb redirection is disabled, no hider setup needed");
+        _usbdk_hider_clear(manager);
+        return;
+    }
+
     if (!priv->auto_connect) {
         SPICE_DEBUG("Auto-connect disabled, no hider setup needed");
         _usbdk_hider_clear(manager);

Comments

On Sun, Apr 09, 2017 at 06:16:45PM +0300, Yuri Benditovich wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1431137
> When auto sharing of USB devices is enabled in remote-viewer's configuration
> file, Windows spice client hides connected USB devices on client machine even
> if USB redirection is disabled by --spice-disable-usbredir.
> 
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> ---
>  src/usb-device-manager.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index 4d0b93d..fc17338 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -1945,6 +1945,12 @@ void _usbdk_hider_update(SpiceUsbDeviceManager *manager)
>          return;
>      }
>  
> +    if (!spice_session_get_usbredir_enabled(priv->session)) {
> +        SPICE_DEBUG("Usb redirection is disabled, no hider setup needed");

"USB redirection disabled, ..."

Acked-by: Christophe Fergeau <cfergeau@redhat.com>

with this change.

Christophe