diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2012-08-05 15:57:44 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2012-08-27 09:13:07 +0300 |
commit | 3af4b7235d23e9d0be2da780d5da9b3fcb29466f (patch) | |
tree | ed5003644f97db35ac29a57791651c0f5180cd4b /server/main_channel.c | |
parent | c617379821feb0c2cf990394163765498ae1bda1 (diff) | |
download | spice-3af4b7235d23e9d0be2da780d5da9b3fcb29466f.tar.gz spice-3af4b7235d23e9d0be2da780d5da9b3fcb29466f.tar.xz spice-3af4b7235d23e9d0be2da780d5da9b3fcb29466f.zip |
main: send MSG_MIGRATE upon vm migration completion
Before sending the above msg, if there is a pending partial msg that
has been read from the agent, we send it to the client. The alternative
was to keep the msg as part of the migration data, and then
to send it to the destination server via the client and to wait there
for the msg chunk completion, before sending it to the client. Of
course, the latter is less efficient.
Diffstat (limited to 'server/main_channel.c')
-rw-r--r-- | server/main_channel.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/main_channel.c b/server/main_channel.c index 648a06d3..6cdbc4dd 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -1160,10 +1160,17 @@ uint64_t main_channel_client_get_bitrate_per_sec(MainChannelClient *mcc) return mcc->bitrate_per_sec; } +static void main_channel_client_migrate(RedChannelClient *rcc) +{ + reds_on_main_channel_migrate(SPICE_CONTAINEROF(rcc, MainChannelClient, base)); + red_channel_client_default_migrate(rcc); +} + MainChannel* main_channel_init(void) { RedChannel *channel; ChannelCbs channel_cbs = { NULL, }; + ClientCbs client_cbs = {NULL, }; channel_cbs.config_socket = main_channel_config_socket; channel_cbs.on_disconnect = main_channel_client_on_disconnect; @@ -1187,6 +1194,9 @@ MainChannel* main_channel_init(void) spice_assert(channel); red_channel_set_cap(channel, SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE); + client_cbs.migrate = main_channel_client_migrate; + red_channel_register_client_cbs(channel, &client_cbs); + return (MainChannel *)channel; } |