[spice-gtk v1 2/2] channel-main: abort migration on bogus server message

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

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

In case server sends start migration without canceling previous one,
abort migration; Also aborts migration if failed to create the
SpiceSession for target host.

Note that the check for the new SpiceSession on target host is done in
spice_session_set_migration_session() already.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/channel-main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/channel-main.c b/src/channel-main.c
index 4305dcd..45fdd58 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -2356,10 +2356,10 @@ static void main_migrate_connect(SpiceChannel *channel,
     CHANNEL_DEBUG(channel, "migrate connect");
     session = spice_channel_get_session(channel);
     mig.session = spice_session_new_from_session(session);
-    if (mig.session == NULL)
-        goto end;
-    if (!spice_session_set_migration_session(session, mig.session))
+    if (!spice_session_set_migration_session(session, mig.session)) {
+        spice_session_abort_migration(session);
         goto end;
+    }
 
     main_priv->migrate_data = &mig;
 
-- 
2.21.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]