[PATCH v2] Add RedsState arg to smartcard_device_connect()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



spice_char_device_set_server() is no longer needed and has been removed.
---
 server/char-device.c | 5 -----
 server/char-device.h | 1 -
 server/reds.c        | 3 +--
 server/smartcard.c   | 8 ++++----
 server/smartcard.h   | 2 +-
 5 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/server/char-device.c b/server/char-device.c
index 74b1362..34b835c 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -1042,11 +1042,6 @@ int spice_char_device_state_restore(SpiceCharDeviceState *dev,
     return TRUE;
 }
 
-void spice_char_device_set_server(SpiceCharDeviceState *dev, SpiceServer *server)
-{
-    dev->reds = server;
-}
-
 SpiceServer* spice_char_device_get_server(SpiceCharDeviceState *dev)
 {
     return dev->reds;
diff --git a/server/char-device.h b/server/char-device.h
index b787855..db72bfe 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -184,7 +184,6 @@ int spice_char_device_client_exists(SpiceCharDeviceState *dev,
 
 void spice_char_device_start(SpiceCharDeviceState *dev);
 void spice_char_device_stop(SpiceCharDeviceState *dev);
-void spice_char_device_set_server(SpiceCharDeviceState *dev, SpiceServer *server);
 SpiceServer* spice_char_device_get_server(SpiceCharDeviceState *dev);
 
 /** Read from device **/
diff --git a/server/reds.c b/server/reds.c
index c33aded..8f26d83 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3097,7 +3097,7 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
     }
 #ifdef USE_SMARTCARD
     else if (strcmp(char_device->subtype, SUBTYPE_SMARTCARD) == 0) {
-        if (!(dev_state = smartcard_device_connect(char_device))) {
+        if (!(dev_state = smartcard_device_connect(reds, char_device))) {
             return -1;
         }
     }
@@ -3120,7 +3120,6 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
         if (reds->vm_running) {
             spice_char_device_start(char_device->st);
         }
-        spice_char_device_set_server(char_device->st, reds);
         reds_char_device_add_state(reds, char_device->st);
     } else {
         spice_warning("failed to create device state for %s", char_device->subtype);
diff --git a/server/smartcard.c b/server/smartcard.c
index 0d6ba7b..e9e58a8 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -114,7 +114,7 @@ static void smartcard_channel_write_to_reader(SpiceCharDeviceWriteBuffer *write_
 
 static MsgItem *smartcard_char_device_on_message_from_device(
     SmartCardDeviceState *state, VSCMsgHeader *header);
-static SmartCardDeviceState *smartcard_device_state_new(SpiceCharDeviceInstance *sin);
+static SmartCardDeviceState *smartcard_device_state_new(RedsState *reds, SpiceCharDeviceInstance *sin);
 static void smartcard_device_state_free(SmartCardDeviceState* st);
 static void smartcard_init(void);
 
@@ -266,7 +266,7 @@ static SpiceCharDeviceInstance *smartcard_readers_get_unattached(void)
     return NULL;
 }
 
-static SmartCardDeviceState *smartcard_device_state_new(SpiceCharDeviceInstance *sin)
+static SmartCardDeviceState *smartcard_device_state_new(RedsState *reds, SpiceCharDeviceInstance *sin)
 {
     SmartCardDeviceState *st;
     SpiceCharDeviceCallbacks chardev_cbs = { NULL, };
@@ -312,11 +312,11 @@ void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device)
     smartcard_device_state_free(st);
 }
 
-SpiceCharDeviceState *smartcard_device_connect(SpiceCharDeviceInstance *char_device)
+SpiceCharDeviceState *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device)
 {
     SmartCardDeviceState *st;
 
-    st = smartcard_device_state_new(char_device);
+    st = smartcard_device_state_new(reds, char_device);
     if (smartcard_char_device_add_to_readers(char_device) == -1) {
         smartcard_device_state_free(st);
         return NULL;
diff --git a/server/smartcard.h b/server/smartcard.h
index f9cbbfc..cf9d49b 100644
--- a/server/smartcard.h
+++ b/server/smartcard.h
@@ -24,7 +24,7 @@
 /*
  * connect to smartcard interface, used by smartcard channel
  */
-SpiceCharDeviceState *smartcard_device_connect(SpiceCharDeviceInstance *char_device);
+SpiceCharDeviceState *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device);
 void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device);
 
 #endif // __SMART_CARD_H__
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]