[libvirt PATCH 5/9] util: Allow validation for single XML node

Peter Krempa pkrempa at redhat.com
Tue Sep 29 09:04:04 UTC 2020


On Mon, Sep 21, 2020 at 15:07:28 +0200, Tim Wiederhake wrote:

No commit message ...

> Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
> ---
>  src/util/virxml.c | 15 +++++++++++++++
>  src/util/virxml.h |  6 ++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/src/util/virxml.c b/src/util/virxml.c
> index 5315d4ff6f..2ec526456f 100644
> --- a/src/util/virxml.c
> +++ b/src/util/virxml.c
> @@ -1320,6 +1320,21 @@ virXMLValidateAgainstSchema(const char *schemafile,
>  }
>  
>  

... or function documentation explaining what this does.

> +int
> +virXMLValidateNodeAgainstSchema(const char *schemafile,
> +                                xmlDocPtr doc,
> +                                xmlNodePtr node)
> +{
> +    xmlNodePtr root;
> +    int ret;
> +
> +    root = xmlDocSetRootElement(doc, node);
> +    ret = virXMLValidateAgainstSchema(schemafile, doc);
> +    xmlDocSetRootElement(doc, root);
> +    return ret;
> +}

Once you add a comment for the function:

Reviewed-by: Peter Krempa <pkrempa at redhat.com>




More information about the libvir-list mailing list