Add a new VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT typed parameter for specifying the save image format. A format specified via the virDomainSaveParams API overrides the save_image_format setting in qemu.conf. The 'raw' format remains the default. Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx> --- include/libvirt/libvirt-domain.h | 13 +++++++++++++ src/libvirt-domain.c | 3 +++ 2 files changed, 16 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index f5420bca6e..b5f2f8a31c 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1700,6 +1700,19 @@ int virDomainRestoreParams (virConnectPtr conn, */ # define VIR_DOMAIN_SAVE_PARAM_DXML "dxml" +/** + * VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT: + * + * an optional parameter used to specify the format of the save image. + * Valid formats are raw, zstd, lzop, gzip, bzip2, and xz. If not + * specified, the save_image_format setting in qemu.conf is used, which + * defaults to raw. As VIR_TYPED_PARAM_STRING. + * + * Since: 11.1.0 + */ +# define VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT "image_format" + + /* See below for virDomainSaveImageXMLFlags */ char * virDomainSaveImageGetXMLDesc (virConnectPtr conn, const char *file, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 072cc32255..4e38d4c868 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -1010,6 +1010,9 @@ virDomainSaveFlags(virDomainPtr domain, const char *to, * If VIR_DOMAIN_SAVE_PARAM_FILE is not provided then a managed save is * performed (see virDomainManagedSave). * + * See VIR_DOMAIN_SAVE_PARAM_* for detailed description of accepted save + * parameters. + * * Returns 0 in case of success and -1 in case of failure. * * Since: 8.4.0 -- 2.43.0