[PATCH spice-gtk v2 02/19] migration: abort migrate on disconnect

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

 



If the session has an ongoing migration, but it is disconnected,
abort it.
---
 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@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]