[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: add current_memkb to libxl_dominfo
# HG changeset patch # User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> # Date 1285172602 -3600 # Node ID 68cd8ae1b6203aa1f730ff4c044f023c81e3738d # Parent e8e3aeed3ebacac6faa5795f67b195a434562323 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@xxxxxxxxxxxxx> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libxl/libxl.c | 3 ++- tools/libxl/libxl.idl | 1 + tools/libxl/xl_cmdimpl.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff -r e8e3aeed3eba -r 68cd8ae1b620 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Wed Sep 22 08:54:08 2010 +0100 +++ b/tools/libxl/libxl.c Wed Sep 22 17:23:22 2010 +0100 @@ -558,7 +558,8 @@ static void xcinfo2xlinfo(const xc_domai 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 -r e8e3aeed3eba -r 68cd8ae1b620 tools/libxl/libxl.idl --- a/tools/libxl/libxl.idl Wed Sep 22 08:54:08 2010 +0100 +++ b/tools/libxl/libxl.idl Wed Sep 22 17:23:22 2010 +0100 @@ -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 -r e8e3aeed3eba -r 68cd8ae1b620 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Wed Sep 22 08:54:08 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Wed Sep 22 17:23:22 2010 +0100 @@ -2218,7 +2218,7 @@ static void list_domains(int verbose, co 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' : '-', _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |