diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/libxl.c | 14 | ||||
-rw-r--r-- | tools/libxl/libxl.h | 1 | ||||
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 24 |
3 files changed, 39 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 { diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index e4a4ab2c7f..4922313e55 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -595,6 +595,7 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k /* wait for the memory target of a domain to be reached */ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs); +uint64_t libxl_get_claiminfo(libxl_ctx *ctx); int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass); int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type); /* libxl_primary_console_exec finds the domid and console number diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5a0506f1e4..c9b71e652f 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -4666,6 +4666,29 @@ static void output_topologyinfo(void) return; } +static void output_claim(void) +{ + long l; + + /* + * Note that the xl.c (which calls us) has already read from the + * global configuration the 'claim_mode' value. + */ + if (!libxl_defbool_val(claim_mode)) + return; + + l = libxl_get_claiminfo(ctx); + if (l < 0) { + fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n", + errno, strerror(errno)); + return; + } + + printf("outstanding_claims : %ld\n", l); + + return; +} + static void print_info(int numa) { output_nodeinfo(); @@ -4676,6 +4699,7 @@ static void print_info(int numa) output_topologyinfo(); output_numainfo(); } + output_claim(); output_xeninfo(); |