summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-05 15:05:20 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-08-27 09:13:06 +0300
commit443b2d4270c7379cb3a54501299223302f54a3db (patch)
tree9c57a0a9f171e4efde6ad7879ed8a18b4f148ae6
parentd866114d9087c66b59ec13742bb6beee79f166d6 (diff)
downloadspice-443b2d4270c7379cb3a54501299223302f54a3db.tar.gz
spice-443b2d4270c7379cb3a54501299223302f54a3db.tar.xz
spice-443b2d4270c7379cb3a54501299223302f54a3db.zip
migration_protocol: add migration data for the main channel (mainly for the agent)
-rw-r--r--server/migration_protocol.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/migration_protocol.h b/server/migration_protocol.h
index 67ad1bf2..d2a55758 100644
--- a/server/migration_protocol.h
+++ b/server/migration_protocol.h
@@ -18,6 +18,8 @@
#ifndef _H_MIGRATION_PROTOCOL
#define _H_MIGRATION_PROTOCOL
+#include <spice/vd_agent.h>
+
/* ************************************************
* src-server to dst-server migration data messages
* ************************************************/
@@ -76,6 +78,37 @@ typedef struct __attribute__ ((__packed__)) SpiceMigrateDataSmartcard {
uint32_t read_data_ptr;
} SpiceMigrateDataSmartcard;
+/* *********************************
+ * main channel (mainly guest agent)
+ * *********************************/
+#define SPICE_MIGRATE_DATA_MAIN_VERSION 1 /* NOTE: increase version when CHAR_DEVICE_VERSION
+ is increased */
+#define SPICE_MIGRATE_DATA_MAIN_MAGIC (*(uint32_t *)"MNMD")
+
+typedef struct __attribute__ ((__packed__)) SpiceMigrateDataMain {
+ SpiceMigrateDataCharDevice agent_base;
+ uint8_t client_agent_started; /* for discarding messages */
+
+ struct __attribute__ ((__packed__)) {
+ /* partial data read from device. Such data is stored only
+ * if the chunk header or the entire msg header haven't yet been read completely.
+ * Once the headers are read, partial reads of chunks can be sent as
+ * smaller chunks to the client, without the roundtrip overhead of migration data */
+ uint32_t chunk_header_size;
+ VDIChunkHeader chunk_header;
+ uint8_t msg_header_done;
+ uint32_t msg_header_partial_len;
+ uint32_t msg_header_ptr;
+ uint32_t msg_remaining;
+ uint8_t msg_filter_result;
+ } agent2client;
+
+ struct __attribute__ ((__packed__)) {
+ uint32_t msg_remaining;
+ uint8_t msg_filter_result;
+ } client2agent;
+} SpiceMigrateDataMain;
+
static inline int migration_protocol_validate_header(SpiceMigrateDataHeader *header,
uint32_t magic,
uint32_t version)