[Spice-commits] server/reds.c server/reds.h server/smartcard.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Oct 27 09:30:14 UTC 2016


 server/reds.c      |    2 +-
 server/reds.h      |    1 +
 server/smartcard.c |    7 ++-----
 3 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 542bc4784668211f838b7b0a18c12e22a9a63e82
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Oct 26 10:21:46 2016 +0100

    Remove g_smartcard_channel global
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index de0d356..eeb6010 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -467,7 +467,7 @@ void reds_unregister_channel(RedsState *reds, RedChannel *channel)
     }
 }
 
-static RedChannel *reds_find_channel(RedsState *reds, uint32_t type, uint32_t id)
+RedChannel *reds_find_channel(RedsState *reds, uint32_t type, uint32_t id)
 {
     GListIter it;
     RedChannel *channel;
diff --git a/server/reds.h b/server/reds.h
index cd62fc1..28e3444 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -47,6 +47,7 @@ void reds_enable_mm_time(RedsState *reds);
 uint32_t reds_get_mm_time(void);
 void reds_register_channel(RedsState *reds, RedChannel *channel);
 void reds_unregister_channel(RedsState *reds, RedChannel *channel);
+RedChannel *reds_find_channel(RedsState *reds, uint32_t type, uint32_t id);
 int reds_get_mouse_mode(RedsState *reds); // used by inputs_channel
 gboolean reds_config_get_agent_mouse(const RedsState *reds); // used by inputs_channel
 int reds_has_vdagent(RedsState *reds); // used by inputs channel
diff --git a/server/smartcard.c b/server/smartcard.c
index 655eaf7..53919c0 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -602,14 +602,11 @@ red_smartcard_channel_class_init(RedSmartcardChannelClass *klass)
 
 }
 
-/* FIXME: remove global */
-RedSmartcardChannel *g_smartcard_channel;
-
 static void smartcard_init(RedsState *reds)
 {
-    spice_assert(!g_smartcard_channel);
+    spice_assert(!reds_find_channel(reds, SPICE_CHANNEL_SMARTCARD, 0));
 
-    g_smartcard_channel = red_smartcard_channel_new(reds);
+    red_smartcard_channel_new(reds);
 }
 
 


More information about the Spice-commits mailing list