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

Submitted by Yonit Halperin on Sept. 19, 2011, 4:46 p.m.

Details

Message ID 1316425632-3816-4-git-send-email-yhalperi@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Yonit Halperin Sept. 19, 2011, 4:46 p.m.
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
---
 server/reds.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

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;
 }
 

Comments

On 09/19/11 11:46, Yonit Halperin wrote:
> Signed-off-by: Yonit Halperin<yhalperi@redhat.com>

What happens on connect timeouts?

cheers,
   Gerd
On 09/19/2011 03:18 PM, Gerd Hoffmann wrote:
> On 09/19/11 11:46, Yonit Halperin wrote:
>> Signed-off-by: Yonit Halperin<yhalperi@redhat.com>
>
> What happens on connect timeouts?
immediately upon client_migrate_info I start a timer of 10 secs. If it 
timeouts before the connection is completed I call the async command 
completion cb and disconnects the client.

Yonit.
>
> cheers,
> Gerd
>