[Spice-devel] [PATCH spice-gtk v2 3/6] Remove spice_usb_acl_helper_close_acl()

Jonathon Jongsma jjongsma at redhat.com
Thu Mar 10 17:17:14 UTC 2016


This function is now only called after the open_acl() task completes,
and in that scenario it basically does the same thing that the
SpiceUsbAclHelper destructor does, so it's pointless. Remove it.
---
 src/channel-usbredir.c |  1 -
 src/usb-acl-helper.c   | 16 ----------------
 src/usb-acl-helper.h   |  1 -
 3 files changed, 18 deletions(-)

diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index 38d5aaf..dd9557b 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -305,7 +305,6 @@ static void spice_usbredir_channel_open_acl_cb(
         priv->state  = STATE_DISCONNECTED;
     }
 
-    spice_usb_acl_helper_close_acl(priv->acl_helper);
     g_clear_object(&priv->acl_helper);
     g_object_set(spice_channel_get_session(SPICE_CHANNEL(channel)),
                  "inhibit-keyboard-grab", FALSE, NULL);
diff --git a/src/usb-acl-helper.c b/src/usb-acl-helper.c
index 9a08fea..1cc2c4f 100644
--- a/src/usb-acl-helper.c
+++ b/src/usb-acl-helper.c
@@ -283,22 +283,6 @@ gboolean spice_usb_acl_helper_open_acl_finish(
 }
 
 G_GNUC_INTERNAL
-void spice_usb_acl_helper_close_acl(SpiceUsbAclHelper *self)
-{
-    g_return_if_fail(SPICE_IS_USB_ACL_HELPER(self));
-
-    SpiceUsbAclHelperPrivate *priv = self->priv;
-
-    /* If the acl open has not completed yet report it as cancelled */
-    if (priv->result) {
-        async_result_set_cancelled(priv->result);
-        g_simple_async_result_complete_in_idle(priv->result);
-    }
-
-    spice_usb_acl_helper_cleanup(self);
-}
-
-G_GNUC_INTERNAL
 void spice_usb_acl_helper_cancel(SpiceUsbAclHelper *self)
 {
     g_return_if_fail(SPICE_IS_USB_ACL_HELPER(self));
diff --git a/src/usb-acl-helper.h b/src/usb-acl-helper.h
index d9a9def..aa5d3d4 100644
--- a/src/usb-acl-helper.h
+++ b/src/usb-acl-helper.h
@@ -65,7 +65,6 @@ void spice_usb_acl_helper_open_acl(SpiceUsbAclHelper *self,
 gboolean spice_usb_acl_helper_open_acl_finish(
     SpiceUsbAclHelper *self, GAsyncResult *res, GError **err);
 
-void spice_usb_acl_helper_close_acl(SpiceUsbAclHelper *self);
 void spice_usb_acl_helper_cancel(SpiceUsbAclHelper *self);
 
 G_END_DECLS
-- 
2.4.3



More information about the Spice-devel mailing list