summaryrefslogtreecommitdiffstats
path: root/server/main_channel.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2011-09-18 10:31:38 +0300
committerYonit Halperin <yhalperi@redhat.com>2011-11-02 11:21:08 +0200
commit70d1161430fd48c46a75d0742cb30315e11bc043 (patch)
treee5f71e14d3ebd572d278b8bf3c5b4d6571ab4798 /server/main_channel.h
parentfc3aa53211a85387df52befcaa8e8f86f7e811f2 (diff)
downloadspice-70d1161430fd48c46a75d0742cb30315e11bc043.tar.gz
spice-70d1161430fd48c46a75d0742cb30315e11bc043.tar.xz
spice-70d1161430fd48c46a75d0742cb30315e11bc043.zip
server,proto: tell the clients to connect to the migration target before migraton starts
(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect (to all the clients that support it) (2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients, or a timeout, in order to complete client_migrate_info monitor command (cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8; Was modified to support the separation of main channel from reds, and multiple clients) Conflicts: server/reds.c
Diffstat (limited to 'server/main_channel.h')
-rw-r--r--server/main_channel.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/main_channel.h b/server/main_channel.h
index 2ae05e8b..f3702e76 100644
--- a/server/main_channel.h
+++ b/server/main_channel.h
@@ -57,6 +57,8 @@ struct MainMigrateData {
typedef struct MainChannel {
RedChannel base;
uint8_t recv_buf[RECEIVE_BUF_SIZE];
+ RedsMigSpice mig_target; // TODO: add refs and release (afrer all clients completed migration in one way or the other?)
+ int num_clients_mig_wait;
} MainChannel;
@@ -80,9 +82,6 @@ void main_channel_push_init(MainChannelClient *mcc, int connection_id, int displ
int current_mouse_mode, int is_client_mouse_allowed, int multi_media_time,
int ram_hint);
void main_channel_push_notify(MainChannel *main_chan, uint8_t *mess, const int mess_len);
-// TODO: consider exporting RedsMigSpice from reds.c
-void main_channel_push_migrate_begin(MainChannel *main_chan, int port, int sport, char *host,
- uint16_t cert_pub_key_type, uint32_t cert_pub_key_len, uint8_t *cert_pub_key);
void main_channel_push_migrate(MainChannel *main_chan);
void main_channel_push_migrate_switch(MainChannel *main_chan);
void main_channel_push_migrate_cancel(MainChannel *main_chan);
@@ -94,5 +93,12 @@ uint32_t main_channel_client_get_link_id(MainChannelClient *mcc);
int main_channel_client_is_low_bandwidth(MainChannelClient *mcc);
uint64_t main_channel_client_get_bitrate_per_sec(MainChannelClient *mcc);
int main_channel_is_connected(MainChannel *main_chan);
+RedChannelClient* main_channel_client_get_base(MainChannelClient* mcc);
+/* semi seamless migration */
+
+/* returns the number of clients that we are waiting for their connection */
+int main_channel_migrate_connect(MainChannel *main_channel, RedsMigSpice *mig_target);
+void main_channel_migrate_cancel_wait(MainChannel *main_chan);
+void main_channel_migrate_complete(MainChannel *main_chan, int success);
#endif