aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
diff options
context:
space:
mode:
authorDario Faggioli <raistlin@linux.it>2012-07-06 13:17:41 +0100
committerDario Faggioli <raistlin@linux.it>2012-07-06 13:17:41 +0100
commit97467ae4a049d30a8bf1d00cec67ff6c41e18168 (patch)
tree72cdf203551432576f9147ae5dff937345995829 /tools/libxc
parent618a40391f353f236c007038147a7b3771032f15 (diff)
downloadxen-97467ae4a049d30a8bf1d00cec67ff6c41e18168.tar.gz
xen-97467ae4a049d30a8bf1d00cec67ff6c41e18168.tar.bz2
xen-97467ae4a049d30a8bf1d00cec67ff6c41e18168.zip
libxl,libxc: introduce libxl_get_numainfo()
Make some NUMA node information available to the toolstack. Achieve this by means of xc_numainfo(), which exposes memory size and amount of free memory of each node, as well as the relative distances of each node to all the others. For properly exposing distances we need the IDL to support arrays. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r--tools/libxc/xc_misc.c14
-rw-r--r--tools/libxc/xenctrl.h6
2 files changed, 20 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 812b127ff3..3c5d64a4d1 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -35,6 +35,20 @@ int xc_get_max_cpus(xc_interface *xch)
return max_cpus;
}
+int xc_get_max_nodes(xc_interface *xch)
+{
+ static int max_nodes = 0;
+ xc_physinfo_t physinfo;
+
+ if ( max_nodes )
+ return max_nodes;
+
+ if ( !xc_physinfo(xch, &physinfo) )
+ max_nodes = physinfo.max_node_id + 1;
+
+ return max_nodes;
+}
+
int xc_get_cpumap_size(xc_interface *xch)
{
return (xc_get_max_cpus(xch) + 7) / 8;
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 15bf8d28cb..91fbb02979 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -329,6 +329,12 @@ int xc_get_cpumap_size(xc_interface *xch);
/* allocate a cpumap */
xc_cpumap_t xc_cpumap_alloc(xc_interface *xch);
+ /*
+ * NODEMAP handling
+ */
+/* return maximum number of NUMA nodes the hypervisor supports */
+int xc_get_max_nodes(xc_interface *xch);
+
/*
* DOMAIN DEBUGGING FUNCTIONS
*/