mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
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:
parent
c40ed4168a
commit
40369ea674
@ -87,7 +87,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
|
|||||||
name = va_arg(ap, const char *);
|
name = va_arg(ap, const char *);
|
||||||
}
|
}
|
||||||
if (!name) {
|
if (!name) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
||||||
_("parameter '%s' not supported"),
|
_("parameter '%s' not supported"),
|
||||||
params[i].field);
|
params[i].field);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user