[Spice-commits] 2 commits - src/map-file src/usb-device-manager.c src/usb-device-manager.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 2 18:59:25 UTC 2020


 src/map-file             |    1 -
 src/usb-device-manager.c |   43 ++++++-------------------------------------
 src/usb-device-manager.h |    4 ----
 3 files changed, 6 insertions(+), 42 deletions(-)

New commits:
commit d24a27b962b9b008313b384c31436d27f6c1ef41
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Sat Feb 1 21:01:43 2020 +0000

    Add a comment to spice_usb_device_manager_is_device_shared_cd
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 22f9fbd..ba127a1 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1507,6 +1507,11 @@ spice_usb_device_manager_is_device_shared_cd(SpiceUsbDeviceManager *manager,
                                              SpiceUsbDevice *device)
 {
 #ifdef USE_USBREDIR
+    /* TODO This function currently return TRUE for all emulated
+     * devices. Currently only shared CDs are implemented as shared
+     * devices but this will break adding new emulated devices.
+     * Check VID/PID in the future.
+     */
     gboolean is_cd = (spice_usb_backend_device_get_libdev(device) == NULL);
 
     return is_cd;
commit 93c72255467e892348e6d05e7e97aecc8e4015ea
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Sat Feb 1 20:58:04 2020 +0000

    Do not export spice_usb_device_manager_remove_shared_cd_device
    
    This function is defined and called only from usb-device-manager.c.
    Avoids to export it making an ABI to maintain in the future.
    This API was added in commit 2a256ad0b4548a7984b54dd42da5c743f920ecd5
    (cfr "add spice_usb_device_manager shared CD related api functions"),
    no release contains it so it's fine to remove it.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/map-file b/src/map-file
index 5ae56c3..d46f2bc 100644
--- a/src/map-file
+++ b/src/map-file
@@ -181,7 +181,6 @@ spice_usb_device_manager_get_type;
 spice_usb_device_manager_is_device_connected;
 spice_usb_device_manager_is_redirecting;
 spice_usb_device_manager_create_shared_cd_device;
-spice_usb_device_manager_remove_shared_cd_device;
 spice_usb_device_manager_is_device_shared_cd;
 spice_usb_device_widget_get_type;
 spice_usb_device_widget_new;
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 066b92e..22f9fbd 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -943,18 +943,7 @@ spice_usb_device_manager_handle_disconnect(SpiceUsbDeviceManager *manager,
                                            SpiceUsbDevice *device)
 {
     if (spice_usb_device_manager_is_device_shared_cd(manager, device)) {
-        GError *err = NULL;
-        gboolean rc;
-
-        rc = spice_usb_device_manager_remove_shared_cd_device(manager, device, &err);
-        if (!rc) {
-            if (err) {
-                SPICE_DEBUG("Failed to remove cd device, %s", err->message);
-                g_error_free(err);
-            } else {
-                SPICE_DEBUG("Failed to remove cd device");
-            }
-        }
+        spice_usb_backend_device_eject(manager->priv->context, device);
     }
 }
 
@@ -1504,31 +1493,6 @@ spice_usb_device_manager_create_shared_cd_device(SpiceUsbDeviceManager *manager,
 #endif
 }
 
-/**
- * spice_usb_device_manager_remove_shared_cd_device:
- * @manager: a #SpiceUsbDeviceManager
- * @device: a #SpiceUsbDevice to remove
- * @err: (allow-none): a return location for a #GError, or %NULL.
- *
- * Removes a shared CD device.
- *
- * Returns: %TRUE if device removed successfully
- */
-gboolean
-spice_usb_device_manager_remove_shared_cd_device(SpiceUsbDeviceManager *manager,
-                                                 SpiceUsbDevice *device,
-                                                 GError **err)
-{
-#ifdef USE_USBREDIR
-    spice_usb_backend_device_eject(manager->priv->context, device);
-    return TRUE;
-#else
-    g_set_error_literal(err, SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
-                        _("USB redirection support not compiled in"));
-    return FALSE;
-#endif
-}
-
 /**
  * spice_usb_device_manager_is_device_shared_cd:
  * @manager: a #SpiceUsbDeviceManager
diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h
index cfa29df..cf3338f 100644
--- a/src/usb-device-manager.h
+++ b/src/usb-device-manager.h
@@ -150,10 +150,6 @@ spice_usb_device_manager_create_shared_cd_device(SpiceUsbDeviceManager *manager,
                                                  gchar *filename,
                                                  GError **err);
 gboolean
-spice_usb_device_manager_remove_shared_cd_device(SpiceUsbDeviceManager *manager,
-                                                 SpiceUsbDevice *device,
-                                                 GError **err);
-gboolean
 spice_usb_device_manager_is_device_shared_cd(SpiceUsbDeviceManager *manager,
                                              SpiceUsbDevice *device);
 


More information about the Spice-commits mailing list