On a Thursday in 2026, Peter Krempa via Devel wrote:
From: Peter Krempa <[email protected]>

While 'virTypedParamsValidate', which uses varargs to pass the template
to validate parameters agains, is convenient for single uses we have

against

multiple occasions where we want to validate the same list of parameters
in muliple places. We use either a macro which expands to the parameter
list in place or a function which encapsulates the validation.

For introspection of input typed parameters we'll need to have the list
of supported typed parameters in each function which uses them as input
and either of the approaches is inconvenient for generating the
introspection parts.

Refactor 'virTypedParamsValidate', to split the actual validation
internals into ''virTypedParamsValidateInternal' and create two
wrappers:
- 'virTypedParamsValidate' which uses varargs
- 'virTypedParamsValidateTemplate' which uses an array of structs
   containing the template.

Signed-off-by: Peter Krempa <[email protected]>
---
src/libvirt_private.syms |   1 +
src/util/virtypedparam.c | 134 +++++++++++++++++++++++++--------------
src/util/virtypedparam.h |  11 ++++
3 files changed, 100 insertions(+), 46 deletions(-)


Reviewed-by: Ján Tomko <[email protected]>

Jano

Attachment: signature.asc
Description: PGP signature

Reply via email to