[PATCH 4/6] network_conf: add validation against schema in create

Ján Tomko jtomko at redhat.com
Thu Sep 2 15:11:03 UTC 2021


On a Thursday in 2021, Kristina Hanicova wrote:
>Signed-off-by: Kristina Hanicova <khanicov at redhat.com>
>---
> src/conf/network_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
>index f23599abac..5e24880f1f 100644
>--- a/src/conf/network_conf.c
>+++ b/src/conf/network_conf.c
>@@ -2093,7 +2093,8 @@ virNetworkDefParse(const char *xmlStr,
>     int keepBlanksDefault = xmlKeepBlanksDefault(0);
>
>     if ((xml = virXMLParse(filename, xmlStr, _("(network_definition)"),
>-                           "network.rng", flags & VIR_NETWORK_DEFINE_VALIDATE)))
>+                           "network.rng", flags & (VIR_NETWORK_DEFINE_VALIDATE |
>+                                                   VIR_NETWORK_CREATE_VALIDATE))))
>         def = virNetworkDefParseNode(xml, xmlDocGetRootElement(xml), xmlopt);
>

This has no functional effect, since 1 | 1 == 1.

I think leaving only one symbolic representation of 1 here is less
confusing.

Jano

>     xmlKeepBlanksDefault(keepBlanksDefault);
>-- 
>2.31.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210902/f7ebda6e/attachment-0001.sig>


More information about the libvir-list mailing list