[Spice-devel] [PATCH v3 17/22] client: main channel migration: do partial cleanup when switching hosts
Yonit Halperin
yhalperi at redhat.com
Sun Sep 25 05:36:55 PDT 2011
Implement on_disconnect_mig_src and on_connect_mig_target in order to avoid
unnecessary cleanups done in on_(disconnet|connect).
In addition, do not request guest display settings changes after migration.
Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
---
client/red_client.cpp | 9 +++++++++
client/red_client.h | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/client/red_client.cpp b/client/red_client.cpp
index be6ef14..42ca311 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -493,6 +493,15 @@ void RedClient::on_disconnect()
(*sync_event)->wait();
}
+void RedClient::on_disconnect_mig_src()
+{
+ _application.deactivate_interval_timer(*_agent_timer);
+ delete[] _agent_msg_data;
+ _agent_msg_data = NULL;
+ _agent_msg_pos = 0;
+ _agent_tokens = 0;
+}
+
void RedClient::delete_channels()
{
Lock lock(_channels_lock);
diff --git a/client/red_client.h b/client/red_client.h
index 1d81468..f47f1cb 100644
--- a/client/red_client.h
+++ b/client/red_client.h
@@ -279,6 +279,8 @@ protected:
virtual void on_connecting();
virtual void on_connect();
virtual void on_disconnect();
+ virtual void on_connect_mig_target() {}
+ virtual void on_disconnect_mig_src();
private:
void on_channel_disconnected(RedChannel& channel);
--
1.7.4.4
More information about the Spice-devel
mailing list