WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: add current_memkb to libxl_dominfo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: add current_memkb to libxl_dominfo
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 09 Oct 2010 14:55:53 -0700
Delivery-date: Sat, 09 Oct 2010 15:01:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: add current_memkb to libxl_dominfo, Xen patchbot-unstable <=