[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] This patch addresses bugzilla #649, enabling `xm list' to display the



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID ec4f43a4730fd4026dc9ac1e9341a50e4216a840
# Parent  ea1ffa51b4121d36cffdc90276378a6ed334c2cc
This patch addresses bugzilla #649, enabling `xm list' to display the
actual amount of memory allocated by a guest.  Also this patch:
  -  makes it more apparent that 'xm mem-set' has no effect on HVM's.
  -  show's that memory is changing if 'xm list' is issued while guest is
ballooning (w/o touching balloon driver)

Signed-off-by: Tommie McAfee <tommie.mcafee@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py      |    4 ++++
 tools/python/xen/xend/server/XMLRPCServer.py |    2 +-
 tools/python/xen/xm/main.py                  |    7 +++++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff -r ea1ffa51b412 -r ec4f43a4730f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Nov 08 09:38:06 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Nov 08 09:50:09 2006 +0000
@@ -1042,6 +1042,10 @@ class XendDomainInfo:
         except:
             log.exception('Failed to restart domain %s.', str(self.domid))
 
+    def getSysMem(self):
+        info = dom_get(self.domid)
+        xs_memory=int(info['mem_kb'])/1024
+        return xs_memory
 
     def _preserveForRestart(self):
         """Preserve a domain that has been shut down, by giving it a new UUID,
diff -r ea1ffa51b412 -r ec4f43a4730f 
tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Wed Nov 08 09:38:06 
2006 +0000
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Wed Nov 08 09:50:09 
2006 +0000
@@ -79,7 +79,7 @@ methods = ['device_create', 'device_conf
            'destroyDevice','getDeviceSxprs',
            'setMemoryTarget', 'setName', 'setVCpuCount', 'shutdown',
            'send_sysrq', 'getVCPUInfo', 'waitForDevices',
-           'getRestartCount']
+           'getRestartCount', 'getSysMem']
 
 exclude = ['domain_create', 'domain_restore']
 
diff -r ea1ffa51b412 -r ec4f43a4730f tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Nov 08 09:38:06 2006 +0000
+++ b/tools/python/xen/xm/main.py       Wed Nov 08 09:50:09 2006 +0000
@@ -563,6 +563,12 @@ def parse_sedf_info(info):
         }
 
 def xm_brief_list(doms):
+    def get_mem_info():
+       dom_sysMem=server.xend.domain.getSysMem(d['domid'])
+       if dom_sysMem:
+               d['mem']=dom_sysMem
+
+
     print '%-40s %3s %5s %5s %10s %9s' % \
           ('Name', 'ID', 'Mem', 'VCPUs', 'State', 'Time(s)')
     
@@ -571,6 +577,7 @@ def xm_brief_list(doms):
     
     for dom in doms:
         d = parse_doms_info(dom)
+        get_mem_info()
         print format % d
 
 def xm_label_list(doms):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.