diff options
author | Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> | 2012-10-25 16:59:08 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-10-25 11:34:35 -0600 |
commit | dae52c3ca701ee7cd654b00375ae06e439010e2f (patch) | |
tree | f7605b7c8f6bcb98d302d026fe4c9d927bfa656d /libvirt-override-api.xml | |
parent | 2594a007509ef20e94636089e26237af7e862609 (diff) | |
download | libvirt-python-v6-dae52c3ca701ee7cd654b00375ae06e439010e2f.tar.gz libvirt-python-v6-dae52c3ca701ee7cd654b00375ae06e439010e2f.tar.xz libvirt-python-v6-dae52c3ca701ee7cd654b00375ae06e439010e2f.zip |
virNodeGetCPUMap: Add python binding
Added a method getCPUMap to virConnect.
It can be used as follows:
import libvirt
import sys
import os
conn = libvirt.openReadOnly(None)
if conn == None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
try:
(cpus, cpumap, online) = conn.getCPUMap(0)
except:
print 'Failed to extract the node cpu map information'
sys.exit(1)
print 'CPUs total %d, online %d' % (cpus, online)
print 'CPU map %s' % str(cpumap)
del conn
print "OK"
sys.exit(0)
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'libvirt-override-api.xml')
-rw-r--r-- | libvirt-override-api.xml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index b76fb4e..a0e0496 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -542,5 +542,11 @@ <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/> <arg name='flags' type='int' info='unused, always pass 0'/> </function> + <function name='virNodeGetCPUMap' file='python'> + <info>Get node CPU information</info> + <return type='str *' info='(cpunum, cpumap, online) on success, None on error'/> + <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/> + <arg name='flags' type='int' info='unused, pass 0'/> + </function> </symbols> </api> |