[virt-tools-list] [PATCH] capabilities: correctly parse "cpus" in the host NUMA topology

Cole Robinson crobinso at redhat.com
Fri Nov 22 12:44:16 UTC 2013


On 11/22/2013 06:28 AM, Giuseppe Scrivano wrote:
> "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 at redhat.com>
> ---
>  virtinst/capabilities.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
> index ec18ac8..34edeed 100644
> --- a/virtinst/capabilities.py
> +++ b/virtinst/capabilities.py
> @@ -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):
> 

ACK

- Cole




More information about the virt-tools-list mailing list