提交 b934d5f4 编写于 作者: M Michal Privoznik

virSysinfoParseXML: Mangle ctxt inside virSysinfoParseXML()

There's no need to set ctxt->node outside of the function. The
function can set it itself - it has all the info needed.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 5dd52ecb
...@@ -15714,10 +15714,13 @@ virSysinfoParseXML(xmlNodePtr node, ...@@ -15714,10 +15714,13 @@ virSysinfoParseXML(xmlNodePtr node,
unsigned char *domUUID, unsigned char *domUUID,
bool uuid_generated) bool uuid_generated)
{ {
VIR_XPATH_NODE_AUTORESTORE(ctxt);
virSysinfoDefPtr def; virSysinfoDefPtr def;
xmlNodePtr tmpnode; xmlNodePtr tmpnode;
g_autofree char *type = NULL; g_autofree char *type = NULL;
ctxt->node = node;
if (!virXMLNodeNameEqual(node, "sysinfo")) { if (!virXMLNodeNameEqual(node, "sysinfo")) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("XML does not contain expected 'sysinfo' element")); _("XML does not contain expected 'sysinfo' element"));
...@@ -22179,8 +22182,6 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -22179,8 +22182,6 @@ virDomainDefParseXML(xmlDocPtr xml,
} }
if ((node = virXPathNode("./sysinfo[1]", ctxt)) != NULL) { if ((node = virXPathNode("./sysinfo[1]", ctxt)) != NULL) {
VIR_XPATH_NODE_AUTORESTORE(ctxt);
ctxt->node = node;
def->sysinfo = virSysinfoParseXML(node, ctxt, def->sysinfo = virSysinfoParseXML(node, ctxt,
def->uuid, uuid_generated); def->uuid, uuid_generated);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册