Changeset 1655:687acb62067d

Show
Ignore:
Timestamp:
06/12/08 13:57:43 (2 months ago)
Author:
klai@…
Branch:
default
Message:

Fix vcpu detection for archs that don't have all the Xen CPU info fields

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Tycoon/Virtualization/XenResources.py

    r1646 r1655  
    4646 
    4747        cpu_info = self.__xen_main._xen_low_level.physinfo() 
    48         num_cpus = (cpu_info['cores_per_socket'] * cpu_info['sockets_per_node']  
    49                     * cpu_info['nr_nodes'] * cpu_info['threads_per_core']) 
     48        num_cpus = ( 
     49            cpu_info.get('nr_nodes', 1) * cpu_info.get('sockets_per_node', 1) 
     50            * cpu_info.get('cores_per_socket', 1)  
     51            * cpu_info.get('threads_per_core', 1)) 
    5052        del cpu_info['total_memory'], cpu_info['free_memory'] 
    5153