From 65a11256f294882d6bd1af4af51e42dbbead650d Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Fri, 12 Apr 2013 12:43:53 -0400 Subject: xl: Fix 'free_memory' to include outstanding_claims value. Updating to make it clear that free_memory reported by 'xl info' is influenced by the outstanding claim value. That is the free memory that will be available to the host once all outstanding claims have been completed. This modifies the behavior that the patch titled "xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)" had - which reported the outstanding claims and nothing else. The free_pages as reported by the hypervisor is the currently available count of pages on the heap. The outstanding pages is the total amount of pages reserved for guests (so not taken from the heap yet). As guests are being populated the memory from the heap shrinks and the outstanding count of pages decreases. The total memory used for guests increases. As the available count of pages on the heap and outstanding claims are intertwined, report the amount of free memory available to be a combination of that. That is free heap memory minus the outstanding pages. We also make some odd choices in reporting. By default we will only display 'outstanding_claims' if the claim_mode is enabled in the global configuration file. However, if there are outstanding claims, we will ignore the claim_mode and report these values. Suggested-by: Ian Jackson Signed-off-by: Konrad Rzeszutek Wilk --- tools/libxl/libxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/libxl/libxl.c') diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index c9905e319b..03a9782de1 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -4068,8 +4068,8 @@ uint64_t libxl_get_claiminfo(libxl_ctx *ctx) "xc_domain_get_outstanding_pages failed."); return ERROR_FAIL; } - /* In MB */ - return (l >> 8); + /* In pages */ + return l; } const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx) -- cgit v1.2.3