diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2012-08-02 11:19:30 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2012-08-27 09:12:50 +0300 |
commit | 8e2576d5ab2f0c2089a74edbb5e3a9c2bfbfb06a (patch) | |
tree | e79ca23a033697a8def4f3b54e703f0ad8efc3f5 /server/main_channel.c | |
parent | 43e0897da5dd880fa9c2df5dd34d9de1ab13b862 (diff) | |
download | spice-8e2576d5ab2f0c2089a74edbb5e3a9c2bfbfb06a.tar.gz spice-8e2576d5ab2f0c2089a74edbb5e3a9c2bfbfb06a.tar.xz spice-8e2576d5ab2f0c2089a74edbb5e3a9c2bfbfb06a.zip |
seamless migration: pre migration phase on the destination side
- handle SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS
- reply with SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK
- prepare the channels for migration according to the migration
type (semi/seamless)
see spice-protocol for more details:
commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
Diffstat (limited to 'server/main_channel.c')
-rw-r--r-- | server/main_channel.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/server/main_channel.c b/server/main_channel.c index 2d7cb025..61230682 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -790,9 +790,9 @@ static void main_channel_release_pipe_item(RedChannelClient *rcc, free(base); } -void main_channel_client_handle_migrate_connected(MainChannelClient *mcc, - int success, - int seamless) +static void main_channel_client_handle_migrate_connected(MainChannelClient *mcc, + int success, + int seamless) { spice_printerr("client %p connected: %d seamless %d", mcc->base.client, success, seamless); if (mcc->mig_wait_connect) { @@ -813,6 +813,18 @@ void main_channel_client_handle_migrate_connected(MainChannelClient *mcc, } } +void main_channel_client_handle_migrate_dst_do_seamless(MainChannelClient *mcc, + uint32_t src_version) +{ + if (reds_on_migrate_dst_set_seamless(mcc, src_version)) { + red_channel_client_pipe_add_type(&mcc->base, + SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK); + } else { + red_channel_client_pipe_add_type(&mcc->base, + SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_NACK); + } +} + void main_channel_client_handle_migrate_end(MainChannelClient *mcc) { if (!red_client_during_migrate_at_target(mcc->base.client)) { @@ -882,6 +894,10 @@ static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint case SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR: main_channel_client_handle_migrate_connected(mcc, FALSE, FALSE); break; + case SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS: + main_channel_client_handle_migrate_dst_do_seamless(mcc, + ((SpiceMsgcMainMigrateDstDoSeamless *)message)->src_version); + break; case SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST: reds_on_main_mouse_mode_request(message, size); break; @@ -1125,6 +1141,7 @@ MainChannel* main_channel_init(void) &channel_cbs); spice_assert(channel); red_channel_set_cap(channel, SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE); + return (MainChannel *)channel; } |