summaryrefslogtreecommitdiff
path: root/gtk/channel-main.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-23 03:43:44 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-01-24 13:24:28 +0100
commit4c012cf3db721351d7dee3fba0ed498aaea26be3 (patch)
tree21db77fdd4e57991a45b45484751d32c4f827b95 /gtk/channel-main.c
parentf4d19b3427b8f27fe9bda94c6120379d79b13547 (diff)
gtk: add SpiceMainChannel::migration-started
With this signal, it is possible for the client to provide sockets to a migrating session.
Diffstat (limited to 'gtk/channel-main.c')
-rw-r--r--gtk/channel-main.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 992f999..1ec5193 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -104,6 +104,7 @@ enum {
SPICE_MAIN_CLIPBOARD_GRAB,
SPICE_MAIN_CLIPBOARD_REQUEST,
SPICE_MAIN_CLIPBOARD_RELEASE,
+ SPICE_MIGRATION_STARTED,
SPICE_MAIN_LAST_SIGNAL,
};
@@ -454,6 +455,29 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
G_TYPE_NONE,
0);
+ /**
+ * SpiceMainChannel::migration-started:
+ * @main: the #SpiceMainChannel that emitted the signal
+ * @session: a migration #SpiceSession
+ *
+ * Inform when migration is starting. Application wishing to make
+ * connections themself can set the #SpiceSession:client-sockets
+ * to @TRUE, then follow #SpiceSession::channel-new creation, and
+ * use spice_channel_open_fd() once the socket is created.
+ *
+ **/
+ signals[SPICE_MIGRATION_STARTED] =
+ g_signal_new("migration-started",
+ G_OBJECT_CLASS_TYPE(gobject_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_OBJECT);
+
+
g_type_class_add_private(klass, sizeof(spice_main_channel));
}
@@ -1153,6 +1177,9 @@ static gboolean migrate_connect(gpointer data)
g_signal_connect(mig->session, "channel-new",
G_CALLBACK(migrate_channel_new_cb), mig);
+ g_signal_emit(mig->channel, signals[SPICE_MIGRATION_STARTED], 0,
+ mig->session);
+
/* the migration process is in 2 steps, first the main channel and
then the rest of the channels */
migrate_channel_connect(mig, SPICE_CHANNEL_MAIN, 0);