Re: [PATCH spice-gtk 04/13] migration: set session migration during connect

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

 



I think short log should talk about "migration session", not "session
migration" ?

Christophe

On Sun, Nov 09, 2014 at 05:31:36PM +0100, Marc-André Lureau wrote:
> Track the migration session earlier, so that disconnecting before
> migration finished will abort and release it.
> ---
>  gtk/channel-main.c       |  2 +-
>  gtk/spice-session-priv.h |  1 -
>  gtk/spice-session.c      | 12 ++++++------
>  3 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 873487b..7cc7630 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -2079,6 +2079,7 @@ static gboolean migrate_connect(gpointer data)
>      mig->session = spice_session_new_from_session(session);
>      mig->session->priv->migration_copy = true;
>      spice_session_set_migration_state(mig->session, SPICE_SESSION_MIGRATION_CONNECTING);
> +    session->priv->migration = g_object_ref(mig->session);
>  
>      if ((c->peer_hdr.major_version == 1) &&
>          (c->peer_hdr.minor_version < 1)) {
> @@ -2179,7 +2180,6 @@ static void main_migrate_connect(SpiceChannel *channel,
>              reply_type = SPICE_MSGC_MAIN_MIGRATE_CONNECTED;
>          }
>          spice_session_set_migration(spice_channel_get_session(channel),
> -                                    mig.session,
>                                      mig.do_seamless);
>      }
>      g_object_unref(mig.session);
> diff --git a/gtk/spice-session-priv.h b/gtk/spice-session-priv.h
> index da43866..d6511a1 100644
> --- a/gtk/spice-session-priv.h
> +++ b/gtk/spice-session-priv.h
> @@ -139,7 +139,6 @@ guint32 spice_session_get_mm_time(SpiceSession *session);
>  
>  void spice_session_switching_disconnect(SpiceSession *session);
>  void spice_session_set_migration(SpiceSession *session,
> -                                 SpiceSession *migration,
>                                   gboolean full_migration);
>  void spice_session_abort_migration(SpiceSession *session);
>  void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigration state);
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 3e3f16d..ad19d93 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -1392,21 +1392,21 @@ void spice_session_switching_disconnect(SpiceSession *self)
>  
>  G_GNUC_INTERNAL
>  void spice_session_set_migration(SpiceSession *session,
> -                                 SpiceSession *migration,
>                                   gboolean full_migration)
>  {
>      SpiceSessionPrivate *s = session->priv;
> -    SpiceSessionPrivate *m = migration->priv;
> +    SpiceSessionPrivate *m;
>      gchar *tmp;
>  
> -    g_return_if_fail(s != NULL);
> +    g_return_if_fail(s->migration != NULL);
> +    m = s->migration->priv;
> +    g_return_if_fail(m->migration_state == SPICE_SESSION_MIGRATION_CONNECTING);
> +
>  
>      s->full_migration = full_migration;
>      spice_session_set_migration_state(session, SPICE_SESSION_MIGRATION_MIGRATING);
>  
> -    g_warn_if_fail(s->migration == NULL);
> -    s->migration = g_object_ref(migration);
> -
> +    /* swapping connection details happens after MIGRATION_CONNECTING state */
>      tmp = s->host;
>      s->host = m->host;
>      m->host = tmp;
> -- 
> 1.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpGKZfFadAnx.pgp
Description: PGP signature

_______________________________________________
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]