diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-10-09 13:13:41 +0200 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-11-02 11:25:59 +0200 |
commit | f683815ad53cc39f485ddac9770e23282ca5c340 (patch) | |
tree | 7e5955361ce1fbf47395d0e18d858c8c566fd58b /server/red_channel.c | |
parent | c88e927fc734fdb8240d925eb9e6a87b203c5bb3 (diff) | |
download | spice-f683815ad53cc39f485ddac9770e23282ca5c340.tar.gz spice-f683815ad53cc39f485ddac9770e23282ca5c340.tar.xz spice-f683815ad53cc39f485ddac9770e23282ca5c340.zip |
server: handling semi-seamless migration in the target side
(1) not sending anything to a migrated client till we recieve SPICE_MSGC_MIGRATE_END
(2) start a new client migration (handle client_migrate_info) only after SPICE_MSGC_MIGRATE_END
from the previous migration was received for this client
(3) use the correct ticket
Note: we assume the same channles are linked before and ater migration. i.e.,
SPICE_MSGC_MAIN_ATTACH_CHANNELS is not sent from the clients.
Diffstat (limited to 'server/red_channel.c')
-rw-r--r-- | server/red_channel.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/red_channel.c b/server/red_channel.c index 51415cbf..2ce0094c 100644 --- a/server/red_channel.c +++ b/server/red_channel.c @@ -1215,7 +1215,7 @@ void red_channel_client_pipe_remove_and_release(RedChannelClient *rcc, * pretty tied together. */ -RedClient *red_client_new() +RedClient *red_client_new(int migrated) { RedClient *client; @@ -1223,6 +1223,7 @@ RedClient *red_client_new() ring_init(&client->channels); pthread_mutex_init(&client->lock, NULL); client->thread_id = pthread_self(); + client->migrated = migrated; return client; } @@ -1286,6 +1287,18 @@ void red_client_set_main(RedClient *client, MainChannelClient *mcc) { client->mcc = mcc; } +void red_client_migrate_complete(RedClient *client) +{ + ASSERT(client->migrated); + client->migrated = FALSE; + reds_on_client_migrate_complete(client); +} + +int red_client_during_migrate_at_target(RedClient *client) +{ + return client->migrated; +} + /* * Functions to push the same item to multiple pipes. */ |