aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-03-15 12:33:30 -0400
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-04-16 16:21:50 +0100
commit8f28de1ec060318d74fa6ad853e814d6a1bf0ba2 (patch)
tree968dfd2a674332ffa1f2a10b53f4725bc9ed8bab /tools/libxl/libxl.c
parentad0fcc9fe5cac8cc79b3ec9508aa655220f1a314 (diff)
downloadxen-8f28de1ec060318d74fa6ad853e814d6a1bf0ba2.tar.gz
xen-8f28de1ec060318d74fa6ad853e814d6a1bf0ba2.tar.bz2
xen-8f28de1ec060318d74fa6ad853e814d6a1bf0ba2.zip
xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)
This patch provides the value of the currently outstanding pages claimed for all domains. This is a total global value that influences the hypervisors' MM system. When a claim call is done, a reservation for a specific amount of pages is set and also a global value is incremented. This global value is then reduced as the domain's memory is populated and eventually reaches zero. The toolstack (libxc) also sets the domain's claim to zero when the population of memory has completed as an extra step. Any call to destroy the domain will also set the domain's claim to zero. If the reservation cannot be meet the guest creation fails immediately instead of taking seconds or minutes (depending on the size of the guest) while the toolstack populates memory. See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode' global config" for details on how it is implemented. The value fluctuates quite often so the value is stale once it is provided to the user-space. However it is useful for diagnostic purposes. It is only printed when the global "claim_mode" option in xl.conf(5) is set to enabled (1). The 'man xl' shows the details of this item. [v1: s/unclaimed/outstanding/] [v2: Made libxl_get_claiminfo return just MemKB suggested by Ian Campbell] [v3: Made libxl_get_claininfo return MemMB to conform to the other values printed] [v4: Improvements suggested by Ian Jackson, also added docs to xl.pod.1] [v5: Clarify how claims are cancelled, split >72 characters - Ian Jackson] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r--tools/libxl/libxl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 572c2c6442..230b9544d6 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4057,6 +4057,20 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
return ret;
}
+uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
+{
+ long l;
+
+ l = xc_domain_get_outstanding_pages(ctx->xch);
+ if (l < 0) {
+ LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_WARNING, l,
+ "xc_domain_get_outstanding_pages failed.");
+ return ERROR_FAIL;
+ }
+ /* In MB */
+ return (l >> 8);
+}
+
const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
{
union {