From 43e0897da5dd880fa9c2df5dd34d9de1ab13b862 Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Wed, 4 Jul 2012 16:23:58 +0300 Subject: seamless migration: pre migration phase on the src side sending SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS and handling SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS The src side signals the client to establish a connection to the destination. In seamless migration, the client is also used to perform a sort of handshake with the destination, for verifying if seamless migration can be supported. see spice-protocol for more details: commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f --- server/reds.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/reds.c') diff --git a/server/reds.c b/server/reds.c index 6397b41a..074a19d8 100644 --- a/server/reds.c +++ b/server/reds.c @@ -240,6 +240,8 @@ typedef struct RedsState { int mig_wait_disconnect; int mig_inprogress; int expect_migrate; + int src_do_seamless_migrate; /* per migration. Updated after the migration handshake + between the 2 servers */ Ring mig_target_clients; int num_mig_target_clients; RedsMigSpice *mig_spice; @@ -1163,8 +1165,9 @@ void reds_on_main_agent_data(MainChannelClient *mcc, void *message, size_t size) spice_char_device_write_buffer_add(reds->agent_state.base, dev_state->recv_from_client_buf); } -void reds_on_main_migrate_connected(void) +void reds_on_main_migrate_connected(int seamless) { + reds->src_do_seamless_migrate = seamless; if (reds->mig_wait_connect) { reds_mig_cleanup(); } @@ -3938,7 +3941,8 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_connect(SpiceServer *s, const char* reds->expect_migrate = TRUE; /* main channel will take care of clients that are still during migration (at target)*/ - if (main_channel_migrate_connect(reds->main_channel, reds->mig_spice)) { + if (main_channel_migrate_connect(reds->main_channel, reds->mig_spice, + reds->seamless_migration_enabled)) { reds_mig_started(); } else { if (reds->num_clients == 0) { -- cgit