[PATCH spice-gtk 5/9] channel: reset migration state when calling channel_reset()

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

 



channel_reset() is called in channel_disconnect(). We can just move that
state change in channel_reset() in order to get rid of
channel_disconnect().
---
 gtk/spice-channel.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index f036105..2df021d 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2629,6 +2629,10 @@ static void channel_reset(SpiceChannel *channel, gboolean migrating)
     spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION);
     spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_MINI_HEADER);
     spice_channel_reset_capabilities(channel);
+
+    if (c->state == SPICE_CHANNEL_STATE_SWITCHING)
+        spice_session_set_migration_state(spice_channel_get_session(channel),
+                                          SPICE_SESSION_MIGRATION_NONE);
 }
 
 /* system or coroutine context */
@@ -2654,11 +2658,6 @@ static void channel_disconnect(SpiceChannel *channel)
     spice_channel_reset(channel, FALSE);
 
     g_return_if_fail(SPICE_IS_CHANNEL(channel));
-
-    if (c->state == SPICE_CHANNEL_STATE_SWITCHING) {
-        spice_session_set_migration_state(spice_channel_get_session(channel),
-                                          SPICE_SESSION_MIGRATION_NONE);
-    }
 }
 
 /**
-- 
2.1.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]