[Spice-devel] [PATCH 12/13] reds: Remove spice_char_device_state_create()

Frediano Ziglio fziglio at redhat.com
Wed Mar 23 12:48:38 UTC 2016


From: Christophe Fergeau <cfergeau at redhat.com>

Nothing is using it anymore now that CharDevice classes are
gobjectified.
---
 server/char-device.c | 42 ------------------------------------------
 server/char-device.h | 11 +----------
 2 files changed, 1 insertion(+), 52 deletions(-)

diff --git a/server/char-device.c b/server/char-device.c
index c835499..e1004d8 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -111,13 +111,6 @@ typedef struct SpiceCharDeviceMsgToClientItem {
     SpiceCharDeviceMsgToClient *msg;
 } SpiceCharDeviceMsgToClientItem;
 
-static RedCharDevice *red_char_device_new(SpiceCharDeviceInstance *sin,
-                                          RedsState *reds,
-                                          uint32_t client_tokens_interval,
-                                          uint32_t self_tokens,
-                                          SpiceCharDeviceCallbacks *cbs,
-                                          void *opaque);
-
 static SpiceCharDeviceMsgToClient *
 spice_char_device_read_one_msg_from_device(SpiceCharDeviceState *dev)
 {
@@ -739,17 +732,6 @@ void spice_char_device_write_buffer_release(SpiceCharDeviceState *dev,
  * char_device_state management *
  ********************************/
 
-SpiceCharDeviceState *spice_char_device_state_create(SpiceCharDeviceInstance *sin,
-                                                     RedsState *reds,
-                                                     uint32_t client_tokens_interval,
-                                                     uint32_t self_tokens,
-                                                     SpiceCharDeviceCallbacks *cbs,
-                                                     void *opaque)
-{
-    return red_char_device_new(sin, reds, client_tokens_interval,
-                               self_tokens, cbs, opaque);
-}
-
 void spice_char_device_state_reset_dev_instance(SpiceCharDeviceState *state,
                                                 SpiceCharDeviceInstance *sin)
 {
@@ -1263,30 +1245,6 @@ red_char_device_init(RedCharDevice *self)
     g_signal_connect(self, "notify::sin", G_CALLBACK(red_char_device_on_sin_changed), NULL);
 }
 
-static RedCharDevice *
-red_char_device_new(SpiceCharDeviceInstance *sin,
-                    RedsState *reds,
-                    uint32_t client_tokens_interval,
-                    uint32_t self_tokens,
-                    SpiceCharDeviceCallbacks *cbs,
-                    void *opaque)
-{
-    RedCharDevice *char_dev;
-
-    char_dev = g_object_new(RED_TYPE_CHAR_DEVICE,
-                            "sin", sin,
-                            "reds", reds,
-                            "client-tokens-interval", (guint64) client_tokens_interval,
-                            "self-tokens", (guint64) self_tokens,
-                            "opaque", opaque,
-                            NULL);
-
-    /* TODO: redundant with the "opaque" property in g_object_new */
-    red_char_device_set_callbacks(char_dev, cbs, opaque);
-
-    return char_dev;
-}
-
 /* TODO: needs to be moved to class vfuncs once all child classes are gobjects */
 void
 red_char_device_set_callbacks(RedCharDevice *dev,
diff --git a/server/char-device.h b/server/char-device.h
index 9a1eb95..d0fc63c 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -61,7 +61,7 @@ void red_char_device_set_callbacks(RedCharDevice *dev,
  *
  * How to use the api:
  * ==================
- * device attached: call spice_char_device_state_create
+ * device attached: create new object instantiating a RedCharDevice child class
  * device detached: call spice_char_device_state_destroy/reset
  *
  * client connected and associated with a device: spice_char_device_client_add
@@ -113,8 +113,6 @@ void red_char_device_set_callbacks(RedCharDevice *dev,
  *
  * */
 
-struct RedsState;
-
 /* buffer that is used for writing to the device */
 typedef struct SpiceCharDeviceWriteBuffer {
     RingItem link;
@@ -163,13 +161,6 @@ struct SpiceCharDeviceCallbacks {
     void (*remove_client)(RedClient *client, void *opaque);
 };
 
-SpiceCharDeviceState *spice_char_device_state_create(SpiceCharDeviceInstance *sin,
-                                                     struct RedsState *reds,
-                                                     uint32_t client_tokens_interval,
-                                                     uint32_t self_tokens,
-                                                     SpiceCharDeviceCallbacks *cbs,
-                                                     void *opaque);
-
 void spice_char_device_state_reset_dev_instance(SpiceCharDeviceState *dev,
                                                 SpiceCharDeviceInstance *sin);
 void spice_char_device_state_destroy(SpiceCharDeviceState *dev);
-- 
2.5.5



More information about the Spice-devel mailing list