[PATCH 1/3] Add public API for parallel compression method

Claudio Fontana cfontana at suse.de
Tue Jan 17 08:44:42 UTC 2023


Hi,

On 1/16/23 14:42, Jiang Jiacheng wrote:
> Add public API VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION,
> VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL, VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL
> for migration APIs to support set compression method
> and compress level used during migration.
> 
> Signed-off-by: Jiang Jiacheng <jiangjiacheng at huawei.com>

we don't know what drivers other than QEMU are going to implement in terms of algorithms,
and we also don't know what new algorithms QEMU will come up with in the future,

so I was told when I was working on something similar (but not identical),
for the "multifd save restore prototype" to try to make it more general.

First of all, maybe we don't need two different _LEVEL parameters,
just a VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION_LEVEL, which is then mapped in the qemu driver to the specific correct QEMU parameter according to the chosen algo.

Then the VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION could be a freeform string, that is then interpreted by each driver, for example "zlib", or "zstd" in this case.

So other drivers can pass different strings, and QEMU future new compression algorithms will not need changes to libvirt at all.

Thanks,

Claudio

> ---
>  include/libvirt/libvirt-domain.h | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index 5152ed4551..981f4e5160 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -1351,6 +1351,36 @@ typedef enum {
>   */
>  # define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS     "parallel.connections"
>  
> +/**
> + * VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION:
> + *
> + * virDomainMigrate* params field: compression method used during parallel
> + * migration. As VIR_TYPED_PARAM_INT.
> + *
> + * Since: 9.1.0
> + */
> +# define VIR_MIGRATE_PARAM_PARALLEL_COMPRESSION     "parallel.compression"
> +
> +/**
> + * VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL:
> + *
> + * virDomainMigrate* params field: zlib compress level used during parallel
> + * migration. As VIR_TYPED_PARAM_INT.
> + *
> + * Since: 9.1.0
> + */
> +# define VIR_MIGRATE_PARAM_PARALLEL_ZLIB_LEVEL      "parallel.zlib.level"
> +
> +/**
> + * VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL:
> + *
> + * virDomainMigrate* params field: zstd compress level used during parallel
> + * migration. As VIR_TYPED_PARAM_INT.
> + *
> + * Since: 9.1.0
> + */
> +# define VIR_MIGRATE_PARAM_PARALLEL_ZSTD_LEVEL      "parallel.zstd.level"
> +
>  /**
>   * VIR_MIGRATE_PARAM_TLS_DESTINATION:
>   *



More information about the libvir-list mailing list