[libvirt] [PATCH 02/21] util: Emit proper error code in virTypedParamsValidate

Jiri Denemark jdenemar at redhat.com
Tue Jun 18 14:05:44 UTC 2013


When unsupported parameter is passed to virTypedParamsValidate,
VIR_ERR_ARGUMENT_UNSUPPORTED should be returned rather than
VIR_ERR_INVALID_ARG, which is more appropriate for supported parameters
used incorrectly.
---
 src/util/virtypedparam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 8b2211f..eef9e30 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -87,7 +87,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
             name = va_arg(ap, const char *);
         }
         if (!name) {
-            virReportError(VIR_ERR_INVALID_ARG,
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
                            _("parameter '%s' not supported"),
                            params[i].field);
             goto cleanup;
-- 
1.8.2.1




More information about the libvir-list mailing list