[Spice-devel] [PATCH spice-gtk 02/13] migration: abort migrate on disconnect

Christophe Fergeau cfergeau at redhat.com
Wed Nov 12 03:40:16 PST 2014


On Sun, Nov 09, 2014 at 05:31:34PM +0100, Marc-André Lureau wrote:
> If the session has an ongoing migration, but it is disconnected,
> abort it.

ACK

> ---
>  gtk/spice-session.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 88bcacd..3e3f16d 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -1467,6 +1467,9 @@ void spice_session_abort_migration(SpiceSession *session)
>          return;
>      }
>  
> +    if (s->migration_state != SPICE_SESSION_MIGRATION_MIGRATING)
> +        goto end;
> +
>      for (ring = ring_get_head(&s->channels);
>           ring != NULL; ring = next) {
>          next = ring_next(&s->channels, ring);
> @@ -1482,6 +1485,7 @@ void spice_session_abort_migration(SpiceSession *session)
>                                           !s->full_migration);
>      }
>  
> +end:
>      g_list_free(s->migration_left);
>      s->migration_left = NULL;
>      spice_session_disconnect(s->migration);
> @@ -1652,6 +1656,7 @@ void spice_session_disconnect(SpiceSession *session)
>      s->name = NULL;
>      memset(s->uuid, 0, sizeof(s->uuid));
>  
> +    spice_session_abort_migration(session);
>      /* we leave disconnecting = TRUE, so that spice_channel_destroy()
>         is not called multiple times on channels that are in pending
>         destroy state. */
> -- 
> 1.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141112/1df8c4c9/attachment.sig>


More information about the Spice-devel mailing list