diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-09-18 21:33:02 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-09-26 12:17:58 +0300 |
commit | 510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d (patch) | |
tree | 0394e311eeb993eb74e280eb0560c35abc485059 /client/red_channel.h | |
parent | 31ed2519a752b7332ed40d0d7ab02e938c0e65cb (diff) | |
download | spice-510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d.tar.gz spice-510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d.tar.xz spice-510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d.zip |
client: handle SPICE_MSG_MAIN_MIGRATE_END
(1) disconnect all channels from the migration src
(2) after all channels are disconnected, clean global resources
(3) send SPICE_MSGC_MAIN_MIGRATE_END to migration target
(4) wait for SPICE_MSG_MAIN_INIT
(4) switch all channels to migration target
Diffstat (limited to 'client/red_channel.h')
-rw-r--r-- | client/red_channel.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/red_channel.h b/client/red_channel.h index a3266809..c47d1433 100644 --- a/client/red_channel.h +++ b/client/red_channel.h @@ -106,6 +106,16 @@ public: virtual void on_event(); }; +class MigrationDisconnectSrcEvent: public Event { +public: + virtual void response(AbstractProcessLoop& events_loop); +}; + +class MigrationConnectTargetEvent: public Event { +public: + virtual void response(AbstractProcessLoop& events_loop); +}; + struct SyncInfo { Mutex* lock; Condition* condition; @@ -126,6 +136,9 @@ public: virtual void disconnect(); virtual bool abort(); + virtual void disconnect_migration_src(); + virtual void connect_migration_target(); + virtual CompoundInMessage *recive(); virtual void post_message(RedChannel::OutMessage* message); @@ -140,6 +153,8 @@ protected: virtual void on_connect() {} virtual void on_disconnect() {} virtual void on_migrate() {} + virtual void on_disconnect_mig_src() { on_disconnect();} + virtual void on_connect_mig_target() { on_connect();} void handle_migrate(RedPeer::InMessage* message); void handle_set_ack(RedPeer::InMessage* message); void handle_ping(RedPeer::InMessage* message); @@ -159,6 +174,8 @@ private: virtual void on_event(); void on_message_recived(); void on_message_complition(uint64_t serial); + void do_migration_disconnect_src(); + void do_migration_connect_target(); static void* worker_main(void *); @@ -203,6 +220,8 @@ private: uint64_t _disconnect_reason; friend class SendTrigger; + friend class MigrationDisconnectSrcEvent; + friend class MigrationConnectTargetEvent; }; |