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

Marc-André Lureau mlureau at redhat.com
Wed Nov 12 07:53:16 PST 2014



----- Original Message -----
> Hi,
> 
> 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);
> 
> Can you rename spice_session_set_migration() to something different as
> this no longer a setter for SpiceSession::migration? ACK with that
> changed (though see my comment on patch 9 which could be squashed here).

It's hard to come up with a better name.

The function is used for seamless and non-seamless migration.

It moves to "migrating" state (connected channels on target now migrate to source session), source session is switch to target server.

What about spice_session_start_migrating() ?


More information about the Spice-devel mailing list