aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-09-22 17:23:22 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-09-22 17:23:22 +0100
commit6f566d13678ed1a13926e464ce4c98c19bb00f99 (patch)
tree1ee237f57a96984133bc9dd40517eab3f0839023 /tools
parent9b0bd3d732b8e7a0dc75810b3c5ebbcc3bab2742 (diff)
downloadxen-6f566d13678ed1a13926e464ce4c98c19bb00f99.tar.gz
xen-6f566d13678ed1a13926e464ce4c98c19bb00f99.tar.bz2
xen-6f566d13678ed1a13926e464ce4c98c19bb00f99.zip
libxl: add current_memkb to libxl_dominfo
currently xcinfo2xlinfo reads tot_pages and uses that data to calculate max_memkb, while tot_pages is the memory currently used by the domain and max_pages is the theoretical maximum. This patch calculates max_memkb from max_pages and introduces current_memkb to store the current memory usage. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxl/libxl.c3
-rw-r--r--tools/libxl/libxl.idl1
-rw-r--r--tools/libxl/xl_cmdimpl.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 59c08f80fe..ab92e53a41 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -558,7 +558,8 @@ static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
else
xlinfo->shutdown_reason = ~0;
- xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
+ xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
+ xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->max_pages);
xlinfo->cpu_time = xcinfo->cpu_time;
xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
xlinfo->vcpu_online = xcinfo->nr_online_vcpus;
diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl
index fd2afd373a..dfd565b998 100644
--- a/tools/libxl/libxl.idl
+++ b/tools/libxl/libxl.idl
@@ -38,6 +38,7 @@ libxl_dominfo = Struct("dominfo",[
Otherwise set to a value guaranteed not to clash with any valid
SHUTDOWN_* constant."""),
+ ("current_memkb", uint64),
("max_memkb", uint64),
("cpu_time", uint64),
("vcpu_max_id", uint32),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9b4cb60e47..0ace4350f4 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2218,7 +2218,7 @@ static void list_domains(int verbose, const libxl_dominfo *info, int nb_domain)
printf("%-40s %5d %5lu %5d %c%c%c%c%c%c %8.1f",
domname,
info[i].domid,
- (unsigned long) (info[i].max_memkb / 1024),
+ (unsigned long) (info[i].current_memkb / 1024),
info[i].vcpu_online,
info[i].running ? 'r' : '-',
info[i].blocked ? 'b' : '-',