summaryrefslogtreecommitdiffstats
path: root/server/spice.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2011-10-03 11:21:38 +0200
committerYonit Halperin <yhalperi@redhat.com>2011-11-02 11:20:08 +0200
commitcd402151def11c5748065de28d124747df09447b (patch)
tree7316f5a1bdf870bcd1af1e0765ab869211eeef4e /server/spice.h
parent0bf518cd3daad526a16468e82c1d6c715535e9ba (diff)
downloadspice-cd402151def11c5748065de28d124747df09447b.tar.gz
spice-cd402151def11c5748065de28d124747df09447b.tar.xz
spice-cd402151def11c5748065de28d124747df09447b.zip
server/spice.h: semi-seamless migration interface, RHBZ #738266
semi-seamless migration details: migration source side --------------------- (1) spice_server_migrate_connect (*): tell client to link to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN. This should be called upon client_migrate_info cmd. client_migrate_info is asynchronous. (2) Complete spice_server_migrate_connect only when the client has been connected to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout. (3) spice_server_migrate_end: tell client migration it can switch to the target - send SPICE_MSG_MAIN_MIGRATE_END. (4) client cleans up all data related to the connection to the source and switches to the target. It sends SPICE_MSGC_MAIN_MIGRATE_END. migration target side --------------------- (1) the server identifies itself as a migraiton target since the client is linked with (connection_id != 0) (2) server doesn't start the channels' logic (channel->link) till it receives SPICE_MSGC_MAIN_MIGRATE_END from the client. * After migration starts, the target qemu is blocked and cannot accept new spice client connections. Thus, we trigger the connection to the target upon client_migrate_info command. (cherry picked from commit 6e56bea67c5648b0c81990171d4bc0cf1a402043 branch 0.8) Conflicts: server/spice.h
Diffstat (limited to 'server/spice.h')
-rw-r--r--server/spice.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/server/spice.h b/server/spice.h
index 74f9fdba..974975a7 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -475,8 +475,26 @@ int spice_server_set_agent_copypaste(SpiceServer *s, int enable);
int spice_server_get_sock_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);
int spice_server_get_peer_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);
-/* spice switch-host client migration */
+/* migration interface */
+#define SPICE_INTERFACE_MIGRATION "migration"
+#define SPICE_INTERFACE_MIGRATION_MAJOR 1
+#define SPICE_INTERFACE_MIGRATION_MINOR 1
+typedef struct SpiceMigrateInterface SpiceMigrateInterface;
+typedef struct SpiceMigrateInstance SpiceMigrateInstance;
+typedef struct SpiceMigrateState SpiceMigrateState;
+
+struct SpiceMigrateInterface {
+ SpiceBaseInterface base;
+ void (*migrate_connect_complete)(SpiceMigrateInstance *sin);
+ void (*migrate_end_complete)(SpiceMigrateInstance *sin);
+};
+
+struct SpiceMigrateInstance {
+ SpiceBaseInstance base;
+ SpiceMigrateState *st;
+};
+/* spice switch-host client migration */
int spice_server_migrate_info(SpiceServer *s, const char* dest,
int port, int secure_port,
const char* cert_subject);
@@ -485,4 +503,11 @@ int spice_server_migrate_switch(SpiceServer *s);
/* server status */
int spice_server_get_num_clients(SpiceServer *s);
+/* spice (semi-)seamless client migration */
+int spice_server_migrate_connect(SpiceServer *s, const char* dest,
+ int port, int secure_port,
+ const char* cert_subject);
+int spice_server_migrate_start(SpiceServer *s);
+int spice_server_migrate_end(SpiceServer *s, int completed);
+
#endif