aboutsummaryrefslogtreecommitdiff
path: root/migration/multifd.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2019-05-15 13:37:46 +0200
committerJuan Quintela <quintela@redhat.com>2020-02-28 09:24:43 +0100
commitab7cbb0b9a3b229025cae3d132504cbb9f25170f (patch)
treefdac5ef4685dd73aa9595e449ee31cfc6032b5c1 /migration/multifd.h
parenta2d07731e7e2f1462e90f9d0a7eaf9e39da29eb0 (diff)
multifd: Make no compression operations into its own structure
It will be used later. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> --- No comp value needs to be zero.
Diffstat (limited to 'migration/multifd.h')
-rw-r--r--migration/multifd.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/migration/multifd.h b/migration/multifd.h
index d8b0205977..54075ffa7d 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -25,6 +25,11 @@ int multifd_queue_page(QEMUFile *f, RAMBlock *block, ram_addr_t offset);
#define MULTIFD_FLAG_SYNC (1 << 0)
+/* We reserve 3 bits for compression methods */
+#define MULTIFD_FLAG_COMPRESSION_MASK (7 << 1)
+/* we need to be compatible. Before compression value was 0 */
+#define MULTIFD_FLAG_NOCOMP (0 << 1)
+
/* This value needs to be a multiple of qemu_target_page_size() */
#define MULTIFD_PACKET_SIZE (512 * 1024)
@@ -96,6 +101,8 @@ typedef struct {
uint64_t num_pages;
/* syncs main thread and channels */
QemuSemaphore sem_sync;
+ /* used for compression methods */
+ void *data;
} MultiFDSendParams;
typedef struct {
@@ -133,7 +140,26 @@ typedef struct {
uint64_t num_pages;
/* syncs main thread and channels */
QemuSemaphore sem_sync;
+ /* used for de-compression methods */
+ void *data;
} MultiFDRecvParams;
+typedef struct {
+ /* Setup for sending side */
+ int (*send_setup)(MultiFDSendParams *p, Error **errp);
+ /* Cleanup for sending side */
+ void (*send_cleanup)(MultiFDSendParams *p, Error **errp);
+ /* Prepare the send packet */
+ int (*send_prepare)(MultiFDSendParams *p, uint32_t used, Error **errp);
+ /* Write the send packet */
+ int (*send_write)(MultiFDSendParams *p, uint32_t used, Error **errp);
+ /* Setup for receiving side */
+ int (*recv_setup)(MultiFDRecvParams *p, Error **errp);
+ /* Cleanup for receiving side */
+ void (*recv_cleanup)(MultiFDRecvParams *p);
+ /* Read all pages */
+ int (*recv_pages)(MultiFDRecvParams *p, uint32_t used, Error **errp);
+} MultiFDMethods;
+
#endif