[Spice-devel] [PATCH spice-gtk 1/2] spice_session_migrate_end: set channel state before calling reset

Hans de Goede hdegoede at redhat.com
Thu Sep 27 08:34:24 PDT 2012


This way functions called from the channel_reset function can rely
on state acurately reflecting the state. This is necessary to stop
channel-usbredir's reset callback from trying to send the initial
hello message while switch-host / semi-seamless migration is still
in progress.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spice-session.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 68d1594..28ebe8a 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -1388,15 +1388,17 @@ void spice_session_migrate_end(SpiceSession *self)
         SpiceChannel *channel = l->data;
         l = l->next;
 
+        if (!SPICE_IS_MAIN_CHANNEL(channel)) {
+            /* freeze other channels */
+            channel->priv->state = SPICE_CHANNEL_STATE_MIGRATING;
+        }
+
         /* reset for migration, disconnect */
         spice_channel_reset(channel, TRUE);
 
         if (SPICE_IS_MAIN_CHANNEL(channel)) {
             /* migrate main to target, so we can start talking */
             spice_session_channel_migrate(self, channel);
-        } else {
-            /* freeze other channels */
-            channel->priv->state = SPICE_CHANNEL_STATE_MIGRATING;
         }
     }
 
-- 
1.7.12



More information about the Spice-devel mailing list