Skip to contentSkip to conversation

xend: Use maxmem value to set domain maxmem

PATCH New Ryan Harper 1 participant 1 message Jul 7, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: Use maxmem value to set domain maxmem

When creating a domain and passing a maxmem value > memory, I get the following output from xen:

(XEN) (file=page_alloc.c, line=603) Over-allocation for domain 1: 32769 > 32768

Xend is using self.info['memory'] to set maxmem rather than the maxmem value. The attached patch fixes xend to use self.info['maxmem'] to set the domain's maxmem value during domain creation.

Signature · 37 lines
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
[email protected]


diffstat output:
 XendDomainInfo.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Signed-off-by: Ryan Harper <[email protected]>
---
# HG changeset patch
# User Ryan Harper <[email protected]>
# Node ID ff76cda5649708a4ab755b40cbd628f0401de118
# Parent  8e55c5c1147589b7a6a1875384d4317aec7ccf84
Currently a domain's maxmem value is being set with the memory value even if the
user specifies maxmem in config.  This patch uses maxmem value to set maxmem
instead of memory.

diff -r 8e55c5c11475 -r ff76cda56497 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Wed Jul  5 17:48:41 2006
+++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Jul  5 14:30:27 2006
@@ -1277,9 +1277,11 @@
                     cpu = [ int( cpus[v % len(cpus)] ) ]
                     xc.vcpu_setaffinity(self.domid, v, cpu)
 
+            # set domain maxmem in KiB
+            xc.domain_setmaxmem(self.domid, self.info['maxmem'] * 1024)
+
             m = self.image.getDomainMemory(self.info['memory'] * 1024)
             balloon.free(m)
-            xc.domain_setmaxmem(self.domid, m)
 
             init_reservation = self.info['memory'] * 1024
             if os.uname()[4] == 'ia64':