diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2010-03-17 18:43:41 +0200 |
---|---|---|
committer | Uri Lublin <uril@redhat.com> | 2010-03-23 14:09:30 +0200 |
commit | 3f757b846c829d1f5d75eeedb2c34d3ab34d5a50 (patch) | |
tree | 0562d1c7a7df5ccc60ed80d48beacdd459867a22 /client/red_client.cpp | |
parent | 6108a6ce5f74c1d466b6ab3e453f2ecbd2dd5a9d (diff) | |
download | spice-client-0.4.2-4.el6.tar.gz spice-client-0.4.2-4.el6.tar.xz spice-client-0.4.2-4.el6.zip |
new migration process #576029 #576031 #576033spice-server-0.4.2-5.el6spice-common-0.4.2-4.el6spice-client-0.4.2-4.el6
- the server acquires the target info from a dedicated Qemu command
- when migration ends, the client receieves a new message RED_MIGRATE_SWITCH_HOST
- client then disconnects from the source and connects to the target. The connection
to the target is entirely new.
Diffstat (limited to 'client/red_client.cpp')
-rw-r--r-- | client/red_client.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/client/red_client.cpp b/client/red_client.cpp index 90793266..9fa2b1a3 100644 --- a/client/red_client.cpp +++ b/client/red_client.cpp @@ -288,6 +288,8 @@ RedClient::RedClient(Application& application) message_loop->set_handler(RED_MIGRATE_BEGIN, &RedClient::handle_migrate_begin, sizeof(RedMigrationBegin)); message_loop->set_handler(RED_MIGRATE_CANCEL, &RedClient::handle_migrate_cancel, 0); + message_loop->set_handler(RED_MIGRATE_SWITCH_HOST, &RedClient::handle_migrate_switch_host, + sizeof(RedMigrationSwitchHost)); message_loop->set_handler(RED_INIT, &RedClient::handle_init, sizeof(RedInit)); message_loop->set_handler(RED_CHANNELS_LIST, &RedClient::handle_channels, sizeof(RedChannels)); @@ -392,7 +394,8 @@ RedPeer::ConnectionOptions::Type RedClient::get_connection_options(uint32_t chan void RedClient::connect() { - //todo wait for disconnect state + //todo wait for disconnect state (but notifce that the main process loop + // must run when waiting for aborts) if (_connection_id || !abort_channels()) { return; } @@ -791,6 +794,21 @@ void RedClient::handle_agent_tokens(RedPeer::InMessage* message) _agent_tokens += token->num_tokens; } +void RedClient::handle_migrate_switch_host(RedPeer::InMessage* message) +{ + RedMigrationSwitchHost* migrate = (RedMigrationSwitchHost*)message->data(); + char* host = ((char*)migrate) + migrate->host_offset; + char* subject = NULL; + if (migrate->cert_subject_size) { + subject = ((char*)migrate)+ migrate->cert_subject_offset; + } + AutoRef<SwitchHostEvent> switch_event(new SwitchHostEvent(host, + migrate->port, + migrate->sport, + subject)); + push_event(*switch_event); +} + void RedClient::migrate_channel(RedChannel& channel) { DBG(0, "channel type %u id %u", channel.get_type(), channel.get_id()); |