From: Ján Tomko Date: Tue, 20 Aug 2019 20:12:55 +0000 (+0200) Subject: conf: ns.parse: decouple call from condition X-Git-Tag: v5.7.0-rc1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94c34cbd665ce4190b2bc2338941b1ef38a8c6e9;p=thirdparty%2Flibvirt.git conf: ns.parse: decouple call from condition In the future we will perform more actions if ns.parse is present. Decouple the condition from the actual call. Signed-off-by: Ján Tomko Reviewed-by: Jiri Denemark --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1f2a91c710..0d786f53d7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21343,9 +21343,10 @@ virDomainDefParseXML(xmlDocPtr xml, */ def->ns = xmlopt->ns; - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - goto error; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + goto error; + } return def; diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index c5a243684a..f55b9e5409 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2050,9 +2050,10 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, if (xmlopt) def->ns = xmlopt->ns; - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - goto error; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + goto error; + } ctxt->node = save; return def; diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 05055cdc29..a2b977989f 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -997,9 +997,10 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) /* Make a copy of all the callback pointers here for easier use, * especially during the virStoragePoolSourceClear method */ def->ns = options->ns; - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - return NULL; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + return NULL; + } VIR_STEAL_PTR(ret, def); return ret;