ia64/xen-unstable

changeset 12308:ec4f43a4730f

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@unisys.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Nov 08 09:50:09 2006 +0000 (2006-11-08)
parents ea1ffa51b412
children 092170a14212
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/server/XMLRPCServer.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Nov 08 09:38:06 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Nov 08 09:50:09 2006 +0000
     1.3 @@ -1042,6 +1042,10 @@ class XendDomainInfo:
     1.4          except:
     1.5              log.exception('Failed to restart domain %s.', str(self.domid))
     1.6  
     1.7 +    def getSysMem(self):
     1.8 +        info = dom_get(self.domid)
     1.9 +        xs_memory=int(info['mem_kb'])/1024
    1.10 +        return xs_memory
    1.11  
    1.12      def _preserveForRestart(self):
    1.13          """Preserve a domain that has been shut down, by giving it a new UUID,
     2.1 --- a/tools/python/xen/xend/server/XMLRPCServer.py	Wed Nov 08 09:38:06 2006 +0000
     2.2 +++ b/tools/python/xen/xend/server/XMLRPCServer.py	Wed Nov 08 09:50:09 2006 +0000
     2.3 @@ -79,7 +79,7 @@ methods = ['device_create', 'device_conf
     2.4             'destroyDevice','getDeviceSxprs',
     2.5             'setMemoryTarget', 'setName', 'setVCpuCount', 'shutdown',
     2.6             'send_sysrq', 'getVCPUInfo', 'waitForDevices',
     2.7 -           'getRestartCount']
     2.8 +           'getRestartCount', 'getSysMem']
     2.9  
    2.10  exclude = ['domain_create', 'domain_restore']
    2.11  
     3.1 --- a/tools/python/xen/xm/main.py	Wed Nov 08 09:38:06 2006 +0000
     3.2 +++ b/tools/python/xen/xm/main.py	Wed Nov 08 09:50:09 2006 +0000
     3.3 @@ -563,6 +563,12 @@ def parse_sedf_info(info):
     3.4          }
     3.5  
     3.6  def xm_brief_list(doms):
     3.7 +    def get_mem_info():
     3.8 +       dom_sysMem=server.xend.domain.getSysMem(d['domid'])
     3.9 +       if dom_sysMem:
    3.10 +               d['mem']=dom_sysMem
    3.11 +
    3.12 +
    3.13      print '%-40s %3s %5s %5s %10s %9s' % \
    3.14            ('Name', 'ID', 'Mem', 'VCPUs', 'State', 'Time(s)')
    3.15      
    3.16 @@ -571,6 +577,7 @@ def xm_brief_list(doms):
    3.17      
    3.18      for dom in doms:
    3.19          d = parse_doms_info(dom)
    3.20 +        get_mem_info()
    3.21          print format % d
    3.22  
    3.23  def xm_label_list(doms):