diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-11 13:03:57 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-11 13:03:57 +0100 |
commit | 4871e12b20d9c720ba781ce6564170bcc97fec27 (patch) | |
tree | 308fa8584b5cd5128270ef9b5bdc5b5e48e6cc97 /xen/common/sysctl.c | |
parent | 929990b94033a5e32fbe24dce79dd6cdfae1d565 (diff) | |
download | xen-4871e12b20d9c720ba781ce6564170bcc97fec27.tar.gz xen-4871e12b20d9c720ba781ce6564170bcc97fec27.tar.bz2 xen-4871e12b20d9c720ba781ce6564170bcc97fec27.zip |
Add new domctl hypercall to expose current heap values. This
functionality is needed for probing how much memory is available in a
given node prior to VM creation.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/sysctl.c')
-rw-r--r-- | xen/common/sysctl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index efc7c2fd1a..98d3777e0a 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -21,6 +21,8 @@ #include <xen/keyhandler.h> #include <asm/current.h> #include <public/sysctl.h> +#include <asm/numa.h> +#include <xen/nodemask.h> extern long arch_do_sysctl( struct xen_sysctl *op, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl); @@ -169,6 +171,18 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) } break; + case XEN_SYSCTL_availheap: + { + op->u.availheap.avail_bytes = avail_domheap_pages_region( + op->u.availheap.node, + op->u.availheap.min_bitwidth, + op->u.availheap.max_bitwidth); + op->u.availheap.avail_bytes <<= PAGE_SHIFT; + + ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0; + } + break; + default: ret = arch_do_sysctl(op, u_sysctl); break; |