aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_misc.c
diff options
context:
space:
mode:
authorJuergen Gross <juergen.gross@ts.fujitsu.com>2010-10-21 18:32:56 +0100
committerJuergen Gross <juergen.gross@ts.fujitsu.com>2010-10-21 18:32:56 +0100
commit63c5ef9841fad351e94f8c2e281c75aedb31ebad (patch)
treea469e97a0ab384e4214eda20ac858404d8fde008 /tools/libxc/xc_misc.c
parentcc0b2bf9de6871cb951fccd4c4e860f08c15e2ec (diff)
downloadxen-63c5ef9841fad351e94f8c2e281c75aedb31ebad.tar.gz
xen-63c5ef9841fad351e94f8c2e281c75aedb31ebad.tar.bz2
xen-63c5ef9841fad351e94f8c2e281c75aedb31ebad.zip
tools: cpupools: Support arbitrary numbers of physical cpus
To be able to support arbitrary numbers of physical cpus it was necessary to include the size of cpumaps in the xc-interfaces for cpu pools. These were: definition of xc_cpupoolinfo_t xc_cpupool_getinfo() xc_cpupool_freeinfo() xc_cpupool_getinfo() and xc_cpupool_freeinfo() are changed to allocate the needed buffer and return it. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r--tools/libxc/xc_misc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 86b4f33158..fe62d82b45 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -21,6 +21,20 @@
#include "xc_private.h"
#include <xen/hvm/hvm_op.h>
+int xc_get_max_cpus(xc_interface *xch)
+{
+ static int max_cpus = 0;
+ xc_physinfo_t physinfo;
+
+ if ( max_cpus )
+ return max_cpus;
+
+ if ( !xc_physinfo(xch, &physinfo) )
+ max_cpus = physinfo.max_cpu_id + 1;
+
+ return max_cpus;
+}
+
int xc_readconsolering(xc_interface *xch,
char *buffer,
unsigned int *pnr_chars,