diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-09-18 21:33:02 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-11-02 11:30:24 +0200 |
commit | c73d5c10e677b8ab67101545bb17eb46afd1e251 (patch) | |
tree | 0a5efceec9aa64f98a982b50b6b142796ec9f73c /client/red_channel.h | |
parent | 6cd3ffba6fbb53102bbaf69bcdba29e5a1db458d (diff) | |
download | spice-c73d5c10e677b8ab67101545bb17eb46afd1e251.tar.gz spice-c73d5c10e677b8ab67101545bb17eb46afd1e251.tar.xz spice-c73d5c10e677b8ab67101545bb17eb46afd1e251.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
(cherry picked from commit 510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d branch 0.8)
Conflicts:
client/red_channel.h
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 6a5a9f6e..ba78acce 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 *receive(); 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_received(); 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; }; |