diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2012-07-04 16:23:58 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2012-08-27 09:12:03 +0300 |
commit | 43e0897da5dd880fa9c2df5dd34d9de1ab13b862 (patch) | |
tree | 515bdfafa3c25310d1f47a8f17afc97dcfcb75f8 /server/reds.c | |
parent | 35cf65a45e5327966d19cd5db0cb2c91bb828abe (diff) | |
download | spice-43e0897da5dd880fa9c2df5dd34d9de1ab13b862.tar.gz spice-43e0897da5dd880fa9c2df5dd34d9de1ab13b862.tar.xz spice-43e0897da5dd880fa9c2df5dd34d9de1ab13b862.zip |
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
Diffstat (limited to 'server/reds.c')
-rw-r--r-- | server/reds.c | 8 |
1 files changed, 6 insertions, 2 deletions
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) { |