提交 4785a401 编写于 作者: P Pavel Hrdina

conf: use virXMLPropString for IOThread pin parsing

XPath is good for random search of elements, not for accessing
attributes of one node.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 954b52cd
...@@ -16362,19 +16362,15 @@ virDomainVcpuPinDefParseXML(virDomainDefPtr def, ...@@ -16362,19 +16362,15 @@ virDomainVcpuPinDefParseXML(virDomainDefPtr def,
*/ */
static int static int
virDomainIOThreadPinDefParseXML(xmlNodePtr node, virDomainIOThreadPinDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt,
virDomainDefPtr def) virDomainDefPtr def)
{ {
int ret = -1; int ret = -1;
virDomainIOThreadIDDefPtr iothrid; virDomainIOThreadIDDefPtr iothrid;
virBitmapPtr cpumask = NULL; virBitmapPtr cpumask = NULL;
xmlNodePtr oldnode = ctxt->node;
unsigned int iothreadid; unsigned int iothreadid;
char *tmp = NULL; char *tmp = NULL;
ctxt->node = node; if (!(tmp = virXMLPropString(node, "iothread"))) {
if (!(tmp = virXPathString("string(./@iothread)", ctxt))) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing iothread id in iothreadpin")); _("missing iothread id in iothreadpin"));
goto cleanup; goto cleanup;
...@@ -16430,7 +16426,6 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node, ...@@ -16430,7 +16426,6 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node,
cleanup: cleanup:
VIR_FREE(tmp); VIR_FREE(tmp);
virBitmapFree(cpumask); virBitmapFree(cpumask);
ctxt->node = oldnode;
return ret; return ret;
} }
...@@ -17705,7 +17700,7 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -17705,7 +17700,7 @@ virDomainDefParseXML(xmlDocPtr xml,
} }
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
if (virDomainIOThreadPinDefParseXML(nodes[i], ctxt, def) < 0) if (virDomainIOThreadPinDefParseXML(nodes[i], def) < 0)
goto error; goto error;
} }
VIR_FREE(nodes); VIR_FREE(nodes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册