From 443b2d4270c7379cb3a54501299223302f54a3db Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Sun, 5 Aug 2012 15:05:20 +0300 Subject: migration_protocol: add migration data for the main channel (mainly for the agent) --- server/migration_protocol.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 + /* ************************************************ * 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) -- cgit