]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
util: Emit proper error code in virTypedParamsValidate
authorJiri Denemark <jdenemar@redhat.com>
Tue, 18 Jun 2013 07:24:57 +0000 (09:24 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 24 Jun 2013 22:38:24 +0000 (00:38 +0200)
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

index 8b2211f41ff1f91e4d5e25d6b8c48e2c98b2b974..eef9e305ca3b4e56a8f111e198a02c744ceb9504 100644 (file)
@@ -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;