summaryrefslogtreecommitdiff
path: root/gtk/spice-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/spice-session.c')
-rw-r--r--gtk/spice-session.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 995b2ed..bfe6b89 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -1194,7 +1194,9 @@ void spice_session_switching_disconnect(SpiceSession *self)
}
G_GNUC_INTERNAL
-void spice_session_set_migration(SpiceSession *session, SpiceSession *migration)
+void spice_session_set_migration(SpiceSession *session,
+ SpiceSession *migration,
+ gboolean seamless)
{
SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session);
SpiceSessionPrivate *m = SPICE_SESSION_GET_PRIVATE(migration);
@@ -1202,7 +1204,9 @@ void spice_session_set_migration(SpiceSession *session, SpiceSession *migration)
g_return_if_fail(s != NULL);
- spice_session_set_migration_state(session, SPICE_SESSION_MIGRATION_MIGRATING);
+ spice_session_set_migration_state(session,
+ seamless ? SPICE_SESSION_MIGRATION_MIGRATING_FULL :
+ SPICE_SESSION_MIGRATION_MIGRATING_SEMI);
g_warn_if_fail(s->migration == NULL);
s->migration = g_object_ref(migration);
@@ -1259,6 +1263,7 @@ void spice_session_abort_migration(SpiceSession *session)
SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session);
RingItem *ring, *next;
struct channel *c;
+ gboolean keep_channel_msgs = s->migration_state == SPICE_SESSION_MIGRATION_MIGRATING_FULL;
g_return_if_fail(s != NULL);
@@ -1278,7 +1283,8 @@ void spice_session_abort_migration(SpiceSession *session)
spice_channel_swap(c->channel,
spice_session_lookup_channel(s->migration,
spice_channel_get_channel_id(c->channel),
- spice_channel_get_channel_type(c->channel)));
+ spice_channel_get_channel_type(c->channel)),
+ keep_channel_msgs);
}
g_list_free(s->migration_left);
@@ -1308,7 +1314,11 @@ void spice_session_channel_migrate(SpiceSession *session, SpiceChannel *channel)
c = spice_session_lookup_channel(s->migration, id, type);
g_return_if_fail(c != NULL);
- spice_channel_swap(channel, c);
+ if (!g_queue_is_empty(&c->priv->xmit_queue) &&
+ s->migration_state == SPICE_SESSION_MIGRATION_MIGRATING_FULL) {
+ g_critical("mig channel xmit queue is not empty. type %s", c->priv->name);
+ }
+ spice_channel_swap(channel, c, s->migration_state == SPICE_SESSION_MIGRATION_MIGRATING_FULL);
s->migration_left = g_list_remove(s->migration_left, channel);
if (g_list_length(s->migration_left) == 0) {