ia64/xen-unstable

changeset 6321:eb2c985e88be

fix logic of ballooning out to handle the dom0_min_mem parameter correctly
add an error message when having not enough memory

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vh249@arcadians.cl.cam.ac.uk
date Sun Aug 21 16:49:54 2005 +0000 (2005-08-21)
parents 342ccfca85d7
children b6ededee6dc9
files tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xm/create.py	Sun Aug 21 16:24:23 2005 +0000
     1.2 +++ b/tools/python/xen/xm/create.py	Sun Aug 21 16:49:54 2005 +0000
     1.3 @@ -688,7 +688,9 @@ def balloon_out(dom0_min_mem, opts):
     1.4      dom0_cur_alloc = get_dom0_alloc()
     1.5      dom0_new_alloc = dom0_cur_alloc - (domU_need_mem - free_mem)
     1.6  
     1.7 -    if free_mem < domU_need_mem and dom0_new_alloc >= dom0_min_mem:
     1.8 +    if free_mem < domU_need_mem and dom0_new_alloc < dom0_min_mem:
     1.9 +        ret = 1
    1.10 +    if free_mem < domU_need_mem and ret == 0:
    1.11  
    1.12          server.xend_domain_mem_target_set(0, dom0_new_alloc)
    1.13  
    1.14 @@ -734,7 +736,8 @@ def main(argv):
    1.15          dom0_min_mem = xroot.get_dom0_min_mem()
    1.16          if dom0_min_mem != 0:
    1.17              if balloon_out(dom0_min_mem, opts):
    1.18 -                return
    1.19 +                print >>sys.stderr, "error: cannot allocate enough memory for domain"
    1.20 +                sys.exit(1)
    1.21  
    1.22          dom = make_domain(opts, config)
    1.23          if opts.vals.console_autoconnect: