From c39d842ff16be4303c48b4faa19f22cd7312b3c7 Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Tue, 20 Sep 2011 14:59:36 +0300 Subject: client: support semi-seamless migration between spice servers with different protocols. It can't actually happen right now, since switch-host migration scheme will take place if the src/target server has protocol 1. (cherry picked from commit 4b2bf4d88c253502003aa5e4b93a045742eec9b4 branch 0.8) --- client/red_channel.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'client/red_channel.cpp') diff --git a/client/red_channel.cpp b/client/red_channel.cpp index d85265b7..e8c058cc 100644 --- a/client/red_channel.cpp +++ b/client/red_channel.cpp @@ -298,6 +298,20 @@ bool RedChannelBase::test_capability(uint32_t cap) return test_capability(_remote_caps, cap); } +void RedChannelBase::swap(RedChannelBase* other) +{ + int tmp_ver; + + RedPeer::swap(other); + tmp_ver = _remote_major; + _remote_major = other->_remote_major; + other->_remote_major = tmp_ver; + + tmp_ver = _remote_minor; + _remote_minor = other->_remote_minor; + other->_remote_minor = tmp_ver; +} + SendTrigger::SendTrigger(RedChannel& channel) : _channel (channel) { @@ -493,6 +507,12 @@ void RedChannel::do_migration_disconnect_src() void RedChannel::do_migration_connect_target() { LOG_INFO(""); + ASSERT(get_client().get_protocol() != 0); + if (get_client().get_protocol() == 1) { + _marshallers = spice_message_marshallers_get1(); + } else { + _marshallers = spice_message_marshallers_get(); + } _loop.add_socket(*this); _socket_in_loop = true; on_connect_mig_target(); -- cgit