[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 3/8] multifd: Make no compression operations into its own
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v5 3/8] multifd: Make no compression operations into its own structure |
Date: |
Fri, 7 Feb 2020 18:45:28 +0000 |
User-agent: |
Mutt/1.13.3 (2020-01-12) |
* Juan Quintela (address@hidden) wrote:
> It will be used later.
>
> Signed-off-by: Juan Quintela <address@hidden>
> diff --git a/migration/multifd.h b/migration/multifd.h
> index d8b0205977..c7fea4914c 100644
> --- a/migration/multifd.h
> +++ b/migration/multifd.h
> @@ -25,6 +25,10 @@ int multifd_queue_page(QEMUFile *f, RAMBlock *block,
> ram_addr_t offset);
>
> #define MULTIFD_FLAG_SYNC (1 << 0)
>
> +/* We reserve 3 bits for METHODS */
> +#define MULTIFD_FLAG_METHOD_MASK (7 << 1)
> +#define MULTIFD_FLAG_NOCOMP (1 << 1)
> +
Doesn't the 'NOCOMP' value have to be 0 for it to not break
compatibility with existing multifd?
Dave
> /* This value needs to be a multiple of qemu_target_page_size() */
> #define MULTIFD_PACKET_SIZE (512 * 1024)
>
> @@ -96,6 +100,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 +139,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
>
> diff --git a/migration/ram.c b/migration/ram.c
> index ed23ed1c7c..73a141bb60 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -43,6 +43,7 @@
> #include "page_cache.h"
> #include "qemu/error-report.h"
> #include "qapi/error.h"
> +#include "qapi/qapi-types-migration.h"
> #include "qapi/qapi-events-migration.h"
> #include "qapi/qmp/qerror.h"
> #include "trace.h"
> --
> 2.24.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [PATCH v5 3/8] multifd: Make no compression operations into its own structure,
Dr. David Alan Gilbert <=