[Spice-devel] [PATCH 12/15] Change reds_main_channel_connected() to take RedsState arg

Frediano Ziglio fziglio at redhat.com
Thu Jan 14 06:33:23 PST 2016


From: Jonathon Jongsma <jjongsma at redhat.com>

---
 server/reds.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 32164f7..28a8e2f 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -481,7 +481,7 @@ static void reds_reset_vdp(RedsState *reds)
     }
 }
 
-static int reds_main_channel_connected(void)
+static int reds_main_channel_connected(RedsState *reds)
 {
     return main_channel_is_connected(reds->main_channel);
 }
@@ -587,7 +587,7 @@ static void reds_disconnect(void)
 
 static void reds_mig_disconnect(void)
 {
-    if (reds_main_channel_connected()) {
+    if (reds_main_channel_connected(reds)) {
         reds_disconnect();
     } else {
         reds_mig_cleanup(reds);
@@ -644,7 +644,7 @@ static void reds_agent_remove(RedsState *reds)
 
     vdagent = NULL;
     reds_update_mouse_mode(reds);
-    if (reds_main_channel_connected() &&
+    if (reds_main_channel_connected(reds) &&
         !red_channel_is_waiting_for_migrate_data(&reds->main_channel->base)) {
         main_channel_push_agent_disconnected(reds->main_channel);
     }
@@ -2539,7 +2539,7 @@ listen:
 
 static void reds_send_mm_time(void)
 {
-    if (!reds_main_channel_connected()) {
+    if (!reds_main_channel_connected(reds)) {
         return;
     }
     spice_debug(NULL);
@@ -2783,7 +2783,7 @@ static void reds_exit(void)
 
 static inline void on_activating_ticketing(void)
 {
-    if (!ticketing_enabled && reds_main_channel_connected()) {
+    if (!ticketing_enabled && reds_main_channel_connected(reds)) {
         spice_warning("disconnecting");
         reds_disconnect();
     }
@@ -3000,7 +3000,7 @@ static SpiceCharDeviceState *attach_to_red_agent(SpiceCharDeviceInstance *sin)
         sif->state(vdagent, 1);
     }
 
-    if (!reds_main_channel_connected()) {
+    if (!reds_main_channel_connected(reds)) {
         return state->base;
     }
 
@@ -3601,7 +3601,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_ticket(SpiceServer *s,
 {
     spice_assert(reds == s);
 
-    if (reds_main_channel_connected()) {
+    if (reds_main_channel_connected(reds)) {
         if (fail_if_connected) {
             return -1;
         }
@@ -3950,7 +3950,7 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_end(SpiceServer *s, int completed)
     }
 
     reds->expect_migrate = FALSE;
-    if (!reds_main_channel_connected()) {
+    if (!reds_main_channel_connected(reds)) {
         spice_info("no peer connected");
         goto complete;
     }
-- 
2.4.3



More information about the Spice-devel mailing list