summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-06 10:33:44 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-08-27 09:13:09 +0300
commit6b741688711697c9ebc698875bdcd884cf0ded46 (patch)
tree88febe3d56e7f7f1f691a1b05dc62f6b872db93d /server
parent35227cd11fe27e882f81009bdc80fdf4d9c4f9b6 (diff)
downloadspice-6b741688711697c9ebc698875bdcd884cf0ded46.tar.gz
spice-6b741688711697c9ebc698875bdcd884cf0ded46.tar.xz
spice-6b741688711697c9ebc698875bdcd884cf0ded46.zip
migration_protocol: add display channel migration data
Diffstat (limited to 'server')
-rw-r--r--server/migration_protocol.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/server/migration_protocol.h b/server/migration_protocol.h
index d2a55758..285d86d1 100644
--- a/server/migration_protocol.h
+++ b/server/migration_protocol.h
@@ -19,6 +19,7 @@
#define _H_MIGRATION_PROTOCOL
#include <spice/vd_agent.h>
+#include "glz_encoder_dictionary.h"
/* ************************************************
* src-server to dst-server migration data messages
@@ -109,6 +110,78 @@ typedef struct __attribute__ ((__packed__)) SpiceMigrateDataMain {
} client2agent;
} SpiceMigrateDataMain;
+/* ****************
+ * display channel
+ * ***************/
+
+#define SPICE_MIGRATE_DATA_DISPLAY_VERSION 1
+#define SPICE_MIGRATE_DATA_DISPLAY_MAGIC (*(uint32_t *)"DCMD")
+
+/*
+ * TODO: store the cache and dictionary data only in one channel (the
+ * freezer).
+ * TODO: optimizations: don't send surfaces information if it will be faster
+ * to resend the surfaces on-demand.
+ * */
+#define MIGRATE_DATA_DISPLAY_MAX_CACHE_CLIENTS 4
+
+typedef struct __attribute__ ((__packed__)) SpiceMigrateDataDisplay {
+ uint64_t message_serial;
+ uint8_t low_bandwidth_setting;
+
+ /*
+ * Synchronizing the shared pixmap cache.
+ * For now, the cache is not migrated, and instead, we reset it and send
+ * SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS to the client.
+ * In order to keep the client and server caches consistent:
+ * The channel which freezed the cache on the src side, unfreezes it
+ * on the dest side, and increases its generation (see 'reset' in red_client_shared_cach.h).
+ * In order to enforce that images that are added to the cache by other channels
+ * will reach the client only after SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS,
+ * we send SPICE_MSG_WAIT_FOR_CHANNELS
+ * (see the generation mismatch handling in 'add' in red_client_shared_cach.h).
+ */
+ uint8_t pixmap_cache_id;
+ int64_t pixmap_cache_size;
+ uint8_t pixmap_cache_freezer;
+ uint64_t pixmap_cache_clients[MIGRATE_DATA_DISPLAY_MAX_CACHE_CLIENTS];
+
+ uint8_t glz_dict_id;
+ GlzEncDictRestoreData glz_dict_data;
+
+ uint32_t surfaces_at_client_ptr; /* reference to MigrateDisplaySurfacesAtClientLossless/Lossy.
+ Lossy: when jpeg-wan-compression(qemu cmd line)=always
+ or when jpeg-wan-compression=auto,
+ and low_bandwidth_setting=TRUE */
+
+} SpiceMigrateDataDisplay;
+
+typedef struct __attribute__ ((__packed__)) SpiceMigrateDataRect {
+ int32_t left;
+ int32_t top;
+ int32_t right;
+ int32_t bottom;
+} SpiceMigrateDataRect;
+
+typedef struct __attribute__ ((__packed__)) MigrateDisplaySurfaceLossless {
+ uint32_t id;
+} MigrateDisplaySurfaceLossless;
+
+typedef struct __attribute__ ((__packed__)) MigrateDisplaySurfaceLossy {
+ uint32_t id;
+ SpiceMigrateDataRect lossy_rect;
+} MigrateDisplaySurfaceLossy;
+
+typedef struct __attribute__ ((__packed__)) MigrateDisplaySurfacesAtClientLossless {
+ uint32_t num_surfaces;
+ MigrateDisplaySurfaceLossless surfaces[0];
+} MigrateDisplaySurfacesAtClientLossless;
+
+typedef struct __attribute__ ((__packed__)) MigrateDisplaySurfacesAtClientLossy {
+ uint32_t num_surfaces;
+ MigrateDisplaySurfaceLossy surfaces[0];
+} MigrateDisplaySurfacesAtClientLossy;
+
static inline int migration_protocol_validate_header(SpiceMigrateDataHeader *header,
uint32_t magic,
uint32_t version)