Adding a new API to obtain information about the
host node's present, online and offline CPUs.
int virNodeGetCPUMapFlags(virConnectPtr conn,
unsigned char **cpumap,
unsigned int *online,
unsigned int flags);
The function will return the number of CPUs present on the host
or -1 on failure;
If cpumap is non-NULL virNodeGetCPUMapFlags will allocate an array
containing a bit map representation of the online CPUs. It's
the callers responsibility to deallocate cpumap using free().
If online is non-NULL, the variable pointed to will contain
the number of online host node CPUs.
The variable flags has been added to support future extensions
and must be set to 0.
Note: the name virNodeGetCPUMapFlags has been chosen to avoid
confusion with the nodeinfo function nodeGetCPUmap.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
include/libvirt/libvirt.h.in | 8 ++++++++
python/generator.py | 1 +
src/libvirt_public.syms | 5 +++++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index a4e8ca9..6b72159 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4500,6 +4500,14 @@ int virNodeSetMemoryParameters(virConnectPtr conn,
int nparams,
unsigned int flags);
+/*
+ * node CPU map
+ */
+int virNodeGetCPUMapFlags(virConnectPtr conn,
+ unsigned char **cpumap,
+ unsigned int *online,
+ unsigned int flags);
+
#ifdef __cplusplus
}
#endif
diff --git a/python/generator.py b/python/generator.py
index ced7e41..8591b8d 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -429,6 +429,7 @@ skip_impl = (
'virConnectRegisterCloseCallback',
'virNodeGetMemoryParameters',
'virNodeSetMemoryParameters',
+ 'virNodeGetCPUMapFlags',
)
qemu_skip_impl = (
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 2c924d5..0c8f4ff 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -569,4 +569,9 @@ LIBVIRT_0.10.2 {
virStoragePoolListAllVolumes;
} LIBVIRT_0.10.0;
+LIBVIRT_1.0.0 {
+ global:
+ virNodeGetCPUMapFlags;
+} LIBVIRT_0.10.2;
+
# .... define new API here using predicted next version number ....
--
1.7.0.4