]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: fix parsing of NUMA settings in VM status XML
authorLuyao Huang <lhuang@redhat.com>
Thu, 19 Mar 2015 10:13:04 +0000 (18:13 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 24 Mar 2015 12:52:24 +0000 (13:52 +0100)
Commit 5bba61f changed the XPath strings to be absolute when parsing
the VM NUMA configuration. Unfortunately the <domain> element is not a
top level element when parsing the domain status XML thus the absolute
XPath string doesn't match.

Use the relative string so that the <numa> settings are not lost.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/conf/numa_conf.c

index 517eaa14390e1daa125be658253db024fc06ca17..8a0f6867e7a5b7bf2dc17bdff6156dcd80205591 100644 (file)
@@ -663,10 +663,10 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
     int ret = -1;
 
     /* check if NUMA definition is present */
-    if (!virXPathNode("/domain/cpu/numa[1]", ctxt))
+    if (!virXPathNode("./cpu/numa[1]", ctxt))
         return 0;
 
-    if ((n = virXPathNodeSet("/domain/cpu/numa[1]/cell", ctxt, &nodes)) <= 0) {
+    if ((n = virXPathNodeSet("./cpu/numa[1]/cell", ctxt, &nodes)) <= 0) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("NUMA topology defined without NUMA cells"));
         goto cleanup;