capabilities: correctly parse "cpus" in the host NUMA topology

"cpus" might no be the only child element in the "cell" element, so be
sure to check all children.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1032320

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2013-11-22 11:28:09 +01:00
parent 6430065bde
commit e51dd1cf40

View File

@ -464,11 +464,11 @@ class TopologyCell(object):
def parseXML(self, node):
self.id = int(node.prop("id"))
child = node.children
if child.name == "cpus":
for cpu in child.children:
if cpu.name == "cpu":
self.cpus.append(TopologyCPU(cpu))
for child in node.children:
if child.name == "cpus":
for cpu in child.children:
if cpu.name == "cpu":
self.cpus.append(TopologyCPU(cpu))
class TopologyCPU(object):