提交 94c34cbd 编写于 作者: J Ján Tomko

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: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 cf400975
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册