From: Keir Fraser Date: Tue, 13 Jan 2009 15:29:06 +0000 (+0000) Subject: xend: fix ballooning bug X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14014^2~71 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=47cee35ef03c542098077bdcf137eaf0f42155ce;p=xen.git 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 Reported-by: Maik Hentsche --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 7feca1c22d..5c08992963 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1199,7 +1199,7 @@ class XendDomainInfo: if self.domid >= 0: if target > memory_cur: - balloon.free( (target-memory_cur)*1024 ) + balloon.free((target - memory_cur) * 1024, self) self.storeVm("memory", target) self.storeDom("memory/target", target << 10) xc.domain_set_target_mem(self.domid, diff --git a/tools/python/xen/xend/balloon.py b/tools/python/xen/xend/balloon.py index 38879affb0..b31398c745 100644 --- a/tools/python/xen/xend/balloon.py +++ b/tools/python/xen/xend/balloon.py @@ -67,7 +67,7 @@ def get_dom0_target_alloc(): raise VmError('Failed to query target memory allocation of dom0.') return kb -def free(need_mem ,self): +def free(need_mem, dominfo): """Balloon out memory from the privileged domain so that there is the specified required amount (in KiB) free. """ @@ -130,7 +130,7 @@ def free(need_mem ,self): if physinfo['nr_nodes'] > 1 and retries == 0: oldnode = -1 waitscrub = 1 - vcpus = self.info['cpus'][0] + vcpus = dominfo.info['cpus'][0] for vcpu in vcpus: nodenum = 0 for node in physinfo['node_to_cpu']: