[virt-tools-list] [PATCH] spice: vv-file: do not ignore usb-filter

Uri Lublin uril at redhat.com
Thu Feb 18 11:44:24 UTC 2016


Fixes rhbz#1309634

Signed-off-by: Uri Lublin <uril at redhat.com>
---
 src/virt-viewer-session-spice.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index b9cae5e..d93edff 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -586,6 +586,16 @@ fill_session(VirtViewerFile *file, SpiceSession *session)
         g_object_set(G_OBJECT(gtk), "auto-usbredir", enabled, NULL);
     }
 
+    if (virt_viewer_file_is_set(file, "usb-filter")) {
+        gchar *filterstr = virt_viewer_file_get_usb_filter(file);
+        SpiceUsbDeviceManager *manager = spice_usb_device_manager_get(session,
+                                                                      NULL);
+        if (manager) {
+            g_object_set(manager, "auto-connect-filter", filterstr, NULL);
+        }
+        g_free(filterstr);
+    }
+
     if (virt_viewer_file_is_set(file, "secure-channels")) {
         gchar **channels = virt_viewer_file_get_secure_channels(file, NULL);
         g_object_set(G_OBJECT(session), "secure-channels", channels, NULL);
-- 
2.5.0




More information about the virt-tools-list mailing list