ia64/xen-unstable

changeset 17827:4c1e740e392c

xend: minor ballooning cleanup

In xend/balloon.py, there's only one place where dom0_start_alloc_mb
is used. Move its initialization to right before its usage.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 10 14:53:01 2008 +0100 (2008-06-10)
parents c7d361cf5793
children 5bf5fb8117c0
files tools/python/xen/xend/balloon.py
line diff
     1.1 --- a/tools/python/xen/xend/balloon.py	Tue Jun 10 14:51:00 2008 +0100
     1.2 +++ b/tools/python/xen/xend/balloon.py	Tue Jun 10 14:53:01 2008 +0100
     1.3 @@ -96,7 +96,6 @@ def free(need_mem):
     1.4      xoptions = XendOptions.instance()
     1.5      dom0 = XendDomain.instance().privilegedDomain()
     1.6      xc = xen.lowlevel.xc.xc()
     1.7 -    dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
     1.8  
     1.9      try:
    1.10          dom0_min_mem = xoptions.get_dom0_min_mem() * 1024
    1.11 @@ -176,6 +175,7 @@ def free(need_mem):
    1.12                  (need_mem, dom0_min_mem, dom0_min_mem,
    1.13                   free_mem + scrub_mem + dom0_alloc - dom0_min_mem))
    1.14          else:
    1.15 +            dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
    1.16              dom0.setMemoryTarget(dom0_start_alloc_mb)
    1.17              raise VmError(
    1.18                  ('Not enough memory is available, and dom0 cannot'