[Spice-devel] [PATCH spice-gtk 5/9] channel: reset migration state when calling channel_reset()
Marc-André Lureau
marcandre.lureau at redhat.com
Mon Feb 16 09:02:26 PST 2015
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
More information about the Spice-devel
mailing list