[Spice-devel] [RFC PATCH spice 0.8 03/19] server: support async client_migrate_info monitor command

Yonit Halperin yhalperi at redhat.com
Mon Sep 19 02:46:56 PDT 2011


Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
---
 server/reds.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 05ebf6e..31f34e2 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -4874,11 +4874,20 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_info(SpiceServer *s, const char* des
                                           const char* cert_subject)
 {
     RedsMigSpice *spice_migration = NULL;
+    SpiceMigrateInterface *sif = NULL;
 
     ASSERT(reds == s);
 
-    if ((port == -1 && secure_port == -1) || !dest)
+    if (migration_interface) {
+        sif = SPICE_CONTAINEROF(migration_interface->base.sif, SpiceMigrateInterface, base);
+    }
+
+    if ((port == -1 && secure_port == -1) || !dest) {
+        if (sif) {
+            sif->migrate_info_complete(migration_interface);
+        }
         return -1;
+    }
 
     spice_migration = spice_new0(RedsMigSpice, 1);
     spice_migration->port = port;
@@ -4890,6 +4899,9 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_info(SpiceServer *s, const char* des
 
     reds_mig_release();
     reds->mig_spice = spice_migration;
+    if (sif) {
+       sif->migrate_info_complete(migration_interface);
+    }
     return 0;
 }
 
-- 
1.7.4.4



More information about the Spice-devel mailing list