lib: Rename VIR_SAVE_PARAM_* to VIR_DOMAIN_SAVE_PARAM_*

A few commits ago new APIs were introduced (virDomainSaveParams()
and virDomainRestoreParams()) and with them new typed parameters:
VIR_SAVE_PARAM_FILE and VIR_SAVE_PARAM_DXML. But their name does
not suggest they apply to either of the APIs nor that they are
intended for domain related APIs. Switch to
VIR_DOMAIN_SAVE_PARAM prefix to make it obvious.

It's true we already have VIR_DOMAIN_SAVE_* symbols which are
part of virDomainSaveRestoreFlags enum, therefore stick also with
'_PARAM_ ' part of the name to differentiate the two.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2022-05-12 09:59:57 +02:00
parent 36e86dbf33
commit 46fa0e46e1
2 changed files with 18 additions and 12 deletions

View File

@ -1579,16 +1579,16 @@ int virDomainRestoreParams (virConnectPtr conn,
unsigned int flags); unsigned int flags);
/** /**
* VIR_SAVE_PARAM_FILE: * VIR_DOMAIN_SAVE_PARAM_FILE:
* *
* the parameter used to specify the savestate file to save to or restore from. * the parameter used to specify the savestate file to save to or restore from.
* *
* Since: 8.4.0 * Since: 8.4.0
*/ */
# define VIR_SAVE_PARAM_FILE "file" # define VIR_DOMAIN_SAVE_PARAM_FILE "file"
/** /**
* VIR_SAVE_PARAM_DXML: * VIR_DOMAIN_SAVE_PARAM_DXML:
* *
* an optional parameter used to adjust guest xml on restore. * an optional parameter used to adjust guest xml on restore.
* If the hypervisor supports it, it can be used to alter * If the hypervisor supports it, it can be used to alter
@ -1598,7 +1598,7 @@ int virDomainRestoreParams (virConnectPtr conn,
* *
* Since: 8.4.0 * Since: 8.4.0
*/ */
# define VIR_SAVE_PARAM_DXML "dxml" # define VIR_DOMAIN_SAVE_PARAM_DXML "dxml"
/* See below for virDomainSaveImageXMLFlags */ /* See below for virDomainSaveImageXMLFlags */
char * virDomainSaveImageGetXMLDesc (virConnectPtr conn, char * virDomainSaveImageGetXMLDesc (virConnectPtr conn,

View File

@ -2823,14 +2823,18 @@ qemuDomainSaveParams(virDomainPtr dom,
VIR_DOMAIN_SAVE_PAUSED, -1); VIR_DOMAIN_SAVE_PAUSED, -1);
if (virTypedParamsValidate(params, nparams, if (virTypedParamsValidate(params, nparams,
VIR_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING, VIR_DOMAIN_SAVE_PARAM_FILE,
VIR_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING, VIR_TYPED_PARAM_STRING,
VIR_DOMAIN_SAVE_PARAM_DXML,
VIR_TYPED_PARAM_STRING,
NULL) < 0) NULL) < 0)
return -1; return -1;
if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_FILE, &to) < 0) if (virTypedParamsGetString(params, nparams,
VIR_DOMAIN_SAVE_PARAM_FILE, &to) < 0)
return -1; return -1;
if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_DXML, &dxml) < 0) if (virTypedParamsGetString(params, nparams,
VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
return -1; return -1;
cfg = virQEMUDriverGetConfig(driver); cfg = virQEMUDriverGetConfig(driver);
@ -5936,14 +5940,16 @@ qemuDomainRestoreParams(virConnectPtr conn,
int ret = -1; int ret = -1;
if (virTypedParamsValidate(params, nparams, if (virTypedParamsValidate(params, nparams,
VIR_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING, VIR_DOMAIN_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING,
VIR_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING, VIR_DOMAIN_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING,
NULL) < 0) NULL) < 0)
return -1; return -1;
if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_FILE, &path) < 0) if (virTypedParamsGetString(params, nparams,
VIR_DOMAIN_SAVE_PARAM_FILE, &path) < 0)
return -1; return -1;
if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_DXML, &dxml) < 0) if (virTypedParamsGetString(params, nparams,
VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
return -1; return -1;
ret = qemuDomainRestoreInternal(conn, path, dxml, flags, ret = qemuDomainRestoreInternal(conn, path, dxml, flags,