From 150ae3e62b98d4f0d7b00d5d8ead99399c6b9d4f Mon Sep 17 00:00:00 2001 From: Jiang Jiacheng Date: Fri, 24 Feb 2023 17:27:10 +0800 Subject: [PATCH] Add public API for parallel compression method Add description for VIR_MIGRATE_PARAM_COMPRESSION, it will be reused in choosing compression method during parallel migration. Add public API VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL, VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL for migration APIs to support set compress level during parallel migration. Signed-off-by: Jiang Jiacheng Signed-off-by: Jiri Denemark Reviewed-by: Jiri Denemark --- include/libvirt/libvirt-domain.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 20862a69f2..3312b8339e 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1270,9 +1270,11 @@ typedef enum { * VIR_MIGRATE_PARAM_COMPRESSION: * * virDomainMigrate* params multiple field: name of the method used to - * compress migration traffic. Supported compression methods: xbzrle, mt. - * The parameter may be specified multiple times if more than one method - * should be used. + * compress migration traffic. Supported compression methods: xbzrle, mt, + * zlib, zstd. The parameter may be specified multiple times if more than + * one method should be used. Not all combinations of compression methods + * and migration options may be allowed. Parallel migration of QEMU domains + * is only compatible with either zlib or zstd method. * * Since: 1.3.4 */ @@ -1319,6 +1321,28 @@ typedef enum { */ # define VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE "compression.xbzrle.cache" +/** + * VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL: + * + * virDomainMigrate* params field: the level of compression for zlib as + * VIR_TYPED_PARAM_INT. Accepted values are in range 0-9. 0 is no compression, + * 1 is maximum speed and 9 is maximum compression. + * + * Since: 9.1.0 + */ +# define VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL "compression.zlib.level" + +/** + * VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL: + * + * virDomainMigrate* params field: the level of compression for zstd as + * VIR_TYPED_PARAM_INT. Accepted values are in range 0-20. 0 is no compression, + * 1 is maximum speed and 20 is maximum compression. + * + * Since: 9.1.0 + */ +# define VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL "compression.zstd.level" + /** * VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL: * -- 2.39.5