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>
This commit is contained in:
Keir Fraser committed 2008-06-10 14:53:01 +01:00
1 parent 4c8dd0578f
commit fa3226f8f3
1 file changed
+1 -1
+1 -1
View File
@@ -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'
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.