summaryrefslogtreecommitdiff
path: root/gtk/channel-main.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-24 00:45:02 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-24 13:24:28 +0100
commitf84be8d41af7c436f2afd6d11990bf5fc04f0032 (patch)
tree1178d4fe062e67e5a5533bfb985f48214a0d1f38 /gtk/channel-main.c
parent0cd3b6122777176336c3138dd603d0c9fbc72cac (diff)
gtk: implement MIGRATE_CANCEL
Diffstat (limited to 'gtk/channel-main.c')
-rw-r--r--gtk/channel-main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index b5bdafd..b099878 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -230,6 +230,9 @@ static void spice_main_channel_dispose(GObject *obj)
g_source_remove(c->switch_host_delayed_id);
c->switch_host_delayed_id = 0;
}
+
+ if (G_OBJECT_CLASS(spice_main_channel_parent_class)->dispose)
+ G_OBJECT_CLASS(spice_main_channel_parent_class)->dispose(obj);
}
static void spice_main_channel_finalize(GObject *obj)
@@ -907,6 +910,7 @@ static void main_handle_channels_list(SpiceChannel *channel, spice_msg_in *in)
c->id = msg->channels[i].id;
/* no need to explicitely switch to main context, since
synchronous call is not needed. */
+ /* no need to track idle, session is refed */
g_idle_add((GSourceFunc)_channel_new, c);
}
}
@@ -1212,13 +1216,17 @@ static void main_handle_migrate_begin(SpiceChannel *channel, spice_msg_in *in)
mig.channel = channel;
mig.info = msg;
mig.from = coroutine_self();
- g_idle_add(migrate_connect, &mig); /* TODO: track idle */
+
+ /* no need to track idle, call is sync for this coroutine */
+ g_idle_add(migrate_connect, &mig);
/* switch to main loop and wait for connections */
coroutine_yield(NULL);
+ g_return_if_fail(mig.session != NULL);
if (mig.nchannels != 0) {
reply_type = SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR;
+ spice_session_disconnect(mig.session);
} else {
SPICE_DEBUG("migration: connections all ok");
reply_type = SPICE_MSGC_MAIN_MIGRATE_CONNECTED;
@@ -1285,7 +1293,11 @@ static void main_handle_migrate_switch_host(SpiceChannel *channel, spice_msg_in
static void main_handle_migrate_cancel(SpiceChannel *channel,
spice_msg_in *in G_GNUC_UNUSED)
{
- g_warning("%s: TODO", __FUNCTION__);
+ SpiceSession *session;
+
+ SPICE_DEBUG("migrate_cancel");
+ session = spice_channel_get_session(channel);
+ spice_session_abort_migration(session);
}
static spice_msg_handler main_handlers[] = {