[PATCHv2 04/22] Add spice_session_is_for_migration()

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

 



---
 doc/reference/spice-gtk-sections.txt |  1 +
 gtk/map-file                         |  1 +
 gtk/spice-glib-sym-file              |  1 +
 gtk/spice-session.c                  | 19 +++++++++++++++++++
 gtk/spice-session.h                  |  1 +
 5 files changed, 23 insertions(+)

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index caaa92c..141a32e 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -29,6 +29,7 @@ spice_session_get_channels
 spice_session_get_read_only
 spice_session_has_channel_type
 spice_session_get_proxy_uri
+spice_session_is_for_migration
 <SUBSECTION>
 SpiceSessionMigration
 SpiceSessionVerify
diff --git a/gtk/map-file b/gtk/map-file
index 3e9624f..d5a073f 100644
--- a/gtk/map-file
+++ b/gtk/map-file
@@ -86,6 +86,7 @@ spice_session_get_proxy_uri;
 spice_session_get_read_only;
 spice_session_get_type;
 spice_session_has_channel_type;
+spice_session_is_for_migration;
 spice_session_migration_get_type;
 spice_session_new;
 spice_session_open_fd;
diff --git a/gtk/spice-glib-sym-file b/gtk/spice-glib-sym-file
index 6ea8aeb..3a8da93 100644
--- a/gtk/spice-glib-sym-file
+++ b/gtk/spice-glib-sym-file
@@ -63,6 +63,7 @@ spice_session_get_proxy_uri
 spice_session_get_read_only
 spice_session_get_type
 spice_session_has_channel_type
+spice_session_is_for_migration
 spice_session_migration_get_type
 spice_session_new
 spice_session_open_fd
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 911bde2..9a043b6 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -2343,3 +2343,22 @@ gboolean spice_session_get_audio_enabled(SpiceSession *session)
 
     return session->priv->audio;
 }
+
+/**
+ * spice_session_is_for_migration:
+ * @session: a Spice session
+ *
+ * During seamless migration, channels may be created to establish a
+ * connection with the target, but they are temporary and should only
+ * handle migration steps. In order to avoid other interactions with
+ * the client, channels should check this value.
+ *
+ * Returns: %TRUE if the session is a copy created during migration
+ * Since: 0.27
+ **/
+gboolean spice_session_is_for_migration(SpiceSession *session)
+{
+    g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE);
+
+    return session->priv->migration_copy;
+}
diff --git a/gtk/spice-session.h b/gtk/spice-session.h
index 4043a64..a79894f 100644
--- a/gtk/spice-session.h
+++ b/gtk/spice-session.h
@@ -96,6 +96,7 @@ GList *spice_session_get_channels(SpiceSession *session);
 gboolean spice_session_has_channel_type(SpiceSession *session, gint type);
 gboolean spice_session_get_read_only(SpiceSession *session);
 SpiceURI *spice_session_get_proxy_uri(SpiceSession *session);
+gboolean spice_session_is_for_migration(SpiceSession *session);
 
 G_END_DECLS
 
-- 
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]