[PATCH v3 5/9] util: multi-value parameters in virTypedParamsAdd*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pavel Boldin <pboldin@xxxxxxxxxxxx>

Allow multi-value parameters to be build using virTypedParamsAdd*
functions by removing check for duplicates.

Signed-off-by: Pavel Boldin <pboldin@xxxxxxxxxxxx>
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virtypedparam.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index ab32fc7..e91ca99 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -748,14 +748,6 @@ virTypedParamsGetString(virTypedParameterPtr params,
 }
 
 
-#define VIR_TYPED_PARAM_CHECK()                                     \
-    do { if (virTypedParamsGet(*params, n, name)) {                 \
-        virReportError(VIR_ERR_INVALID_ARG,                         \
-                       _("Parameter '%s' is already set"), name);   \
-        goto error;                                                 \
-    } } while (0)
-
-
 /**
  * virTypedParamsAddInt:
  * @params: pointer to the array of typed parameters
@@ -786,7 +778,6 @@ virTypedParamsAddInt(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -834,7 +825,6 @@ virTypedParamsAddUInt(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -882,7 +872,6 @@ virTypedParamsAddLLong(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -930,7 +919,6 @@ virTypedParamsAddULLong(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -978,7 +966,6 @@ virTypedParamsAddDouble(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -1026,7 +1013,6 @@ virTypedParamsAddBoolean(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -1077,7 +1063,6 @@ virTypedParamsAddString(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
@@ -1135,7 +1120,6 @@ virTypedParamsAddFromString(virTypedParameterPtr *params,
 
     virResetLastError();
 
-    VIR_TYPED_PARAM_CHECK();
     if (VIR_RESIZE_N(*params, max, n, 1) < 0)
         goto error;
     *maxparams = max;
-- 
2.3.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]