[Spice-devel] [spice PATCH 34/55] migration_protocol: add migration data for the main channel (mainly for the agent)

Yonit Halperin yhalperi at redhat.com
Wed Aug 15 00:56:14 PDT 2012


---
 server/migration_protocol.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/server/migration_protocol.h b/server/migration_protocol.h
index 67ad1bf..d2a5575 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)
-- 
1.7.7.6



More information about the Spice-devel mailing list