diff options
author | Steven Hand <steven@xensource.com> | 2007-06-27 21:01:08 +0100 |
---|---|---|
committer | Steven Hand <steven@xensource.com> | 2007-06-27 21:01:08 +0100 |
commit | 3bc33badf2f2afcb61dca3ee5446e4c13f0c26b4 (patch) | |
tree | 1cdbf0b71c06cedc476fffaa68abd2c2db35b83a /tools/libxc/xc_misc.c | |
parent | cee3908623186dd5e0bd79f302f65671deea799c (diff) | |
download | xen-3bc33badf2f2afcb61dca3ee5446e4c13f0c26b4.tar.gz xen-3bc33badf2f2afcb61dca3ee5446e4c13f0c26b4.tar.bz2 xen-3bc33badf2f2afcb61dca3ee5446e4c13f0c26b4.zip |
Add new sysctl to return runtime information about physical CPU utilization.
Signed-off-by: Steven Hadn <steven@xensource.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r-- | tools/libxc/xc_misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index 987eb0eb13..e17bf7f721 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -109,6 +109,25 @@ int xc_perfc_control(int xc_handle, return rc; } +int xc_cpuinfo(int xc_handle, int max_cpus, uint64_t *info, int *nr_cpus) +{ + int ret; + DECLARE_SYSCTL; + + sysctl.cmd = XEN_SYSCTL_cpuinfo; + sysctl.u.cpuinfo.max_cpus = max_cpus; + set_xen_guest_handle(sysctl.u.cpuinfo.buffer, info); + + if ( (ret = do_sysctl(xc_handle, &sysctl)) != 0 ) + return ret; + + if(nr_cpus) + *nr_cpus = sysctl.u.cpuinfo.nr_cpus; + + return 0; +} + + int xc_hvm_set_pci_intx_level( int xc_handle, domid_t dom, uint8_t domain, uint8_t bus, uint8_t device, uint8_t intx, |