[PATCH] lib: Rename VIR_SAVE_PARAM_* to VIR_DOMAIN_SAVE_PARAM_*

Michal Privoznik mprivozn at redhat.com
Thu May 12 08:31:10 UTC 2022


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 at redhat.com>
---
 include/libvirt/libvirt-domain.h |  8 ++++----
 src/qemu/qemu_driver.c           | 22 ++++++++++++++--------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index cf9d9efd51..24846046aa 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1579,16 +1579,16 @@ int                     virDomainRestoreParams  (virConnectPtr conn,
                                                  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.
  *
  * 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.
  * If the hypervisor supports it, it can be used to alter
@@ -1598,7 +1598,7 @@ int                     virDomainRestoreParams  (virConnectPtr conn,
  *
  * Since: 8.4.0
  */
-# define VIR_SAVE_PARAM_DXML                     "dxml"
+# define VIR_DOMAIN_SAVE_PARAM_DXML             "dxml"
 
 /* See below for virDomainSaveImageXMLFlags */
 char *          virDomainSaveImageGetXMLDesc    (virConnectPtr conn,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e3582f62a7..41c6836390 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2823,14 +2823,18 @@ qemuDomainSaveParams(virDomainPtr dom,
                   VIR_DOMAIN_SAVE_PAUSED, -1);
 
     if (virTypedParamsValidate(params, nparams,
-                               VIR_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING,
-                               VIR_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING,
+                               VIR_DOMAIN_SAVE_PARAM_FILE,
+                               VIR_TYPED_PARAM_STRING,
+                               VIR_DOMAIN_SAVE_PARAM_DXML,
+                               VIR_TYPED_PARAM_STRING,
                                NULL) < 0)
         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;
-    if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_DXML, &dxml) < 0)
+    if (virTypedParamsGetString(params, nparams,
+                                VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
         return -1;
 
     cfg = virQEMUDriverGetConfig(driver);
@@ -5936,14 +5940,16 @@ qemuDomainRestoreParams(virConnectPtr conn,
     int ret = -1;
 
     if (virTypedParamsValidate(params, nparams,
-                               VIR_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING,
-                               VIR_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING,
+                               VIR_DOMAIN_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING,
+                               VIR_DOMAIN_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING,
                                NULL) < 0)
         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;
-    if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_DXML, &dxml) < 0)
+    if (virTypedParamsGetString(params, nparams,
+                                VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
         return -1;
 
     ret = qemuDomainRestoreInternal(conn, path, dxml, flags,
-- 
2.35.1



More information about the libvir-list mailing list