mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
41002e30c7
commit
ac31115528
3 files changed
+12
-1
No files matched your search
@@ -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,
|
||||
|
||||
@@ -79,7 +79,7 @@ methods = ['device_create', 'device_configure',
|
||||
'destroyDevice','getDeviceSxprs',
|
||||
'setMemoryTarget', 'setName', 'setVCpuCount', 'shutdown',
|
||||
'send_sysrq', 'getVCPUInfo', 'waitForDevices',
|
||||
'getRestartCount']
|
||||
'getRestartCount', 'getSysMem']
|
||||
|
||||
exclude = ['domain_create', 'domain_restore']
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||