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.
This commit is contained in:
Jiri Denemark 2013-06-18 09:24:57 +02:00
parent c40ed4168a
commit 40369ea674

View 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;