aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-10 14:53:01 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-10 14:53:01 +0100
commitfa3226f8f359b9fd1dde68884212e09a90690b91 (patch)
treebd93db7b42883062973d3b65b5aba17c42770782 /tools/python
parent4c8dd0578f57886e1ecb6ddae53d1be6e7772607 (diff)
downloadxen-fa3226f8f359b9fd1dde68884212e09a90690b91.tar.gz
xen-fa3226f8f359b9fd1dde68884212e09a90690b91.tar.bz2
xen-fa3226f8f359b9fd1dde68884212e09a90690b91.zip
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>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/xen/xend/balloon.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/python/xen/xend/balloon.py b/tools/python/xen/xend/balloon.py
index 5f2c41915e..ccb51ba9af 100644
--- a/tools/python/xen/xend/balloon.py
+++ b/tools/python/xen/xend/balloon.py
@@ -96,7 +96,6 @@ def free(need_mem):
xoptions = XendOptions.instance()
dom0 = XendDomain.instance().privilegedDomain()
xc = xen.lowlevel.xc.xc()
- dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
try:
dom0_min_mem = xoptions.get_dom0_min_mem() * 1024
@@ -176,6 +175,7 @@ def free(need_mem):
(need_mem, dom0_min_mem, dom0_min_mem,
free_mem + scrub_mem + dom0_alloc - dom0_min_mem))
else:
+ dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
dom0.setMemoryTarget(dom0_start_alloc_mb)
raise VmError(
('Not enough memory is available, and dom0 cannot'