[Spice-devel] [PATCH spice-gtk 03/15] Add spice_session_is_migration_copy()
Marc-André Lureau
marcandre.lureau at gmail.com
Tue Nov 25 06:04:03 PST 2014
I think I would prefer the name spcie_session_is_temporary() or
spcie_session_is_for_migration() instead (migration_copy was
introduced by Yonit, but in fact the migration session isn't a "copy"
at all)
On Tue, Nov 25, 2014 at 2:19 PM, Marc-André Lureau
<marcandre.lureau at redhat.com> wrote:
> ---
> 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..cd0fd82 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_migration_copy
> <SUBSECTION>
> SpiceSessionMigration
> SpiceSessionVerify
> diff --git a/gtk/map-file b/gtk/map-file
> index 3e9624f..6200050 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_migration_copy;
> 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..a54eab5 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_migration_copy
> 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 b24fab9..9d5cb13 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -2345,3 +2345,22 @@ gboolean spice_session_get_audio_enabled(SpiceSession *session)
>
> return session->priv->audio;
> }
> +
> +/**
> + * spice_session_is_migration_copy:
> + * @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_migration_copy(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..b44cae4 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_migration_copy(SpiceSession *session);
>
> G_END_DECLS
>
> --
> 2.1.0
>
--
Marc-André Lureau
More information about the Spice-devel
mailing list