ia64/xen-unstable

changeset 19034:d8267d3d2665

xend: fix ballooning bug

c/s 18960 introduced a bug when xend balloons memory. The function
balloon.free requires a reference to a XendDomainInfo object, which is
missing in one call of this function. Attached patch fixes this. Also
replaced the variable name "self" in the (classless) function with
something more descriptive.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Reported-by: Maik Hentsche <maik.hentsche@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 13 15:29:06 2009 +0000 (2009-01-13)
parents 73770182aee4
children b169db55faf3
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/balloon.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 13 15:16:46 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 13 15:29:06 2009 +0000
     1.3 @@ -1199,7 +1199,7 @@ class XendDomainInfo:
     1.4  
     1.5          if self.domid >= 0:
     1.6              if target > memory_cur:
     1.7 -                balloon.free( (target-memory_cur)*1024 )
     1.8 +                balloon.free((target - memory_cur) * 1024, self)
     1.9              self.storeVm("memory", target)
    1.10              self.storeDom("memory/target", target << 10)
    1.11              xc.domain_set_target_mem(self.domid,
     2.1 --- a/tools/python/xen/xend/balloon.py	Tue Jan 13 15:16:46 2009 +0000
     2.2 +++ b/tools/python/xen/xend/balloon.py	Tue Jan 13 15:29:06 2009 +0000
     2.3 @@ -67,7 +67,7 @@ def get_dom0_target_alloc():
     2.4          raise VmError('Failed to query target memory allocation of dom0.')
     2.5      return kb
     2.6  
     2.7 -def free(need_mem ,self):
     2.8 +def free(need_mem, dominfo):
     2.9      """Balloon out memory from the privileged domain so that there is the
    2.10      specified required amount (in KiB) free.
    2.11      """
    2.12 @@ -130,7 +130,7 @@ def free(need_mem ,self):
    2.13          if physinfo['nr_nodes'] > 1 and retries == 0:
    2.14              oldnode = -1
    2.15              waitscrub = 1
    2.16 -            vcpus = self.info['cpus'][0]
    2.17 +            vcpus = dominfo.info['cpus'][0]
    2.18              for vcpu in vcpus:
    2.19                  nodenum = 0
    2.20                  for node in physinfo['node_to_cpu']: