[PATCH spice-gtk 4/9] channel: use exisiting reconnection code when switching

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

 



Switching for migration reason is similar to a reconnection during
initial connection.

A notable difference is that new code path doesn't schedule a
delayed_unref callback. This is fine since the channel is still running
and delayed_unref is mainly used for signaling disconnections and none
should be emitted when switching.
---
 gtk/spice-channel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index e3c4299..f036105 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2437,7 +2437,8 @@ cleanup:
 
     SPICE_CHANNEL_GET_CLASS(channel)->channel_disconnect(channel);
 
-    if (c->state == SPICE_CHANNEL_STATE_RECONNECTING) {
+    if (c->state == SPICE_CHANNEL_STATE_RECONNECTING ||
+        c->state == SPICE_CHANNEL_STATE_SWITCHING) {
         g_warn_if_fail(c->event == SPICE_CHANNEL_NONE);
         channel_connect(channel, c->tls);
         g_object_unref(channel);
@@ -2655,7 +2656,6 @@ static void channel_disconnect(SpiceChannel *channel)
     g_return_if_fail(SPICE_IS_CHANNEL(channel));
 
     if (c->state == SPICE_CHANNEL_STATE_SWITCHING) {
-        channel_connect(channel, c->tls);
         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]