From: stefano.stabellini@eu.citrix.com Subject: [PATCH 1 of 9] libxl: Fix xcinfo2xlinfo to properly set max_memkb and target_memkb Date: Fri, 27 Aug 2010 14:53:19 +0100 Message-ID: <1282917207-15869-1-git-send-email-stefano.stabellini@eu.citrix.com> References: Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Stefano Stabellini diff -r eccfdeb41b80 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Tue Aug 24 18:42:59 2010 +0100 +++ b/tools/libxl/libxl.c Wed Aug 25 20:59:35 2010 +0100 @@ -539,7 +539,8 @@ static void xcinfo2xlinfo(const xc_domai else xlinfo->shutdown_reason = ~0; - xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages); + xlinfo->target_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 eccfdeb41b80 tools/libxl/libxl.idl --- a/tools/libxl/libxl.idl Tue Aug 24 18:42:59 2010 +0100 +++ b/tools/libxl/libxl.idl Wed Aug 25 20:59:35 2010 +0100 @@ -36,6 +36,7 @@ libxl_dominfo = Struct("dominfo",[ Otherwise set to a value guaranteed not to clash with any valid SHUTDOWN_* constant."""), + ("target_memkb", uint64), ("max_memkb", uint64), ("cpu_time", uint64), ("vcpu_max_id", uint32), diff -r eccfdeb41b80 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Tue Aug 24 18:42:59 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Wed Aug 25 20:59:35 2010 +0100 @@ -2209,7 +2209,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].target_memkb / 1024), info[i].vcpu_online, info[i].running ? 'r' : '-', info[i].blocked ? 'b' : '-',