ia64/xen-unstable

diff tools/python/xen/xend/balloon.py @ 18129:0bf73f557f41

xend balloon: portability cleanup

Move the linux specific labels to osdep where they
belong. Modification on Solaris code ok'd by SUN (Ryan Scott).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 22 11:55:06 2008 +0100 (2008-07-22)
parents 4c1e740e392c
children b1b9cf7a2d36
line diff
     1.1 --- a/tools/python/xen/xend/balloon.py	Tue Jul 22 08:01:56 2008 +0100
     1.2 +++ b/tools/python/xen/xend/balloon.py	Tue Jul 22 11:55:06 2008 +0100
     1.3 @@ -39,11 +39,11 @@ SLEEP_TIME_GROWTH = 0.1
     1.4  
     1.5  # A mapping between easy-to-remember labels and the more verbose
     1.6  # label actually shown in the PROC_XEN_BALLOON file.
     1.7 -labels = { 'current'      : 'Current allocation',
     1.8 -           'target'       : 'Requested target',
     1.9 -           'low-balloon'  : 'Low-mem balloon',
    1.10 -           'high-balloon' : 'High-mem balloon',
    1.11 -           'limit'        : 'Xen hard limit' }
    1.12 +#labels = { 'current'      : 'Current allocation',
    1.13 +#           'target'       : 'Requested target',
    1.14 +#           'low-balloon'  : 'Low-mem balloon',
    1.15 +#           'high-balloon' : 'High-mem balloon',
    1.16 +#           'limit'        : 'Xen hard limit' }
    1.17  
    1.18  def _get_proc_balloon(label):
    1.19      """Returns the value for the named label.  Returns None if the label was
    1.20 @@ -54,7 +54,7 @@ def _get_proc_balloon(label):
    1.21  def get_dom0_current_alloc():
    1.22      """Returns the current memory allocation (in KiB) of dom0."""
    1.23  
    1.24 -    kb = _get_proc_balloon(labels['current'])
    1.25 +    kb = _get_proc_balloon('current')
    1.26      if kb == None:
    1.27          raise VmError('Failed to query current memory allocation of dom0.')
    1.28      return kb
    1.29 @@ -62,7 +62,7 @@ def get_dom0_current_alloc():
    1.30  def get_dom0_target_alloc():
    1.31      """Returns the target memory allocation (in KiB) of dom0."""
    1.32  
    1.33 -    kb = _get_proc_balloon(labels['target'])
    1.34 +    kb = _get_proc_balloon('target')
    1.35      if kb == None:
    1.36          raise VmError('Failed to query target memory allocation of dom0.')
    1.37      return kb