diff options
Diffstat (limited to 'nova/virt/libvirt/host.py')
-rw-r--r-- | nova/virt/libvirt/host.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nova/virt/libvirt/host.py b/nova/virt/libvirt/host.py index b986702401..9658a5791d 100644 --- a/nova/virt/libvirt/host.py +++ b/nova/virt/libvirt/host.py @@ -740,6 +740,14 @@ class Host(object): return doms + def get_available_cpus(self): + """Get the set of CPUs that exist on the host. + + :returns: set of CPUs, raises libvirtError on error + """ + cpus, cpu_map, online = self.get_connection().getCPUMap() + return {cpu for cpu in range(cpus)} + def get_online_cpus(self): """Get the set of CPUs that are online on the host |