From: Jiri Denemark Date: Tue, 18 Jun 2013 07:24:57 +0000 (+0200) Subject: util: Emit proper error code in virTypedParamsValidate X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=40369ea674e2f0ab300a8e683e5cd9c5cfaee8f0;p=libvirt.git util: Emit proper error code in virTypedParamsValidate 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. --- diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index 8b2211f41f..eef9e305ca 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;