[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEND] Fix maxmem config issues.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 73b59ad4dd42dcf13ae756a3c0b73a987db9660f
# Parent  0946c90c11056954f041cecb81fa03000f878926
[XEND] Fix maxmem config issues.
Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    8 ++++++--
 tools/python/xen/xend/image.py          |   13 ++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff -r 0946c90c1105 -r 73b59ad4dd42 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Dec 13 11:01:33 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Dec 13 11:07:47 2006 +0000
@@ -896,6 +896,10 @@ class XendDomainInfo:
         """Get this domain's target memory size, in KB."""
         return self.info['memory_static_min'] * 1024
 
+    def getMemoryMaximum(self):
+        """Get this domain's maximum memory size, in KB."""
+        return self.info['memory_static_max'] * 1024
+
     def getResume(self):
         return str(self._resume)
 
@@ -1363,9 +1367,9 @@ class XendDomainInfo:
             # Use architecture- and image-specific calculations to determine
             # the various headrooms necessary, given the raw configured
             # values. maxmem, memory, and shadow are all in KiB.
+            memory = self.image.getRequiredAvailableMemory(
+                self.info['memory_static_min'] * 1024)
             maxmem = self.image.getRequiredAvailableMemory(
-                self.info['memory_static_min'] * 1024)
-            memory = self.image.getRequiredAvailableMemory(
                 self.info['memory_static_max'] * 1024)
             shadow = self.image.getRequiredShadowMemory(
                 self.info['shadow_memory'] * 1024,
diff -r 0946c90c1105 -r 73b59ad4dd42 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Dec 13 11:01:33 2006 +0000
+++ b/tools/python/xen/xend/image.py    Wed Dec 13 11:07:47 2006 +0000
@@ -144,6 +144,14 @@ class ImageHandler:
         architecture- or image-specific code may override this to
         add headroom where necessary."""
         return self.getRequiredAvailableMemory(self.vm.getMemoryTarget())
+
+    def getRequiredMaximumReservation(self):
+        """@param mem_kb The maximum possible memory, in KiB.
+        @return The corresponding required amount of memory to be free, also
+        in KiB. This is normally the same as getRequiredAvailableMemory, but
+        architecture- or image-specific code may override this to
+        add headroom where necessary."""
+        return self.getRequiredAvailableMemory(self.vm.getMemoryMaximum())
 
     def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
         """@param shadow_mem_kb The configured shadow memory, in KiB.
@@ -593,6 +601,9 @@ class X86_HVM_ImageHandler(HVMImageHandl
     def getRequiredInitialReservation(self):
         return self.vm.getMemoryTarget()
 
+    def getRequiredMaximumReservation(self):
+        return self.vm.getMemoryMaximum()
+
     def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
         # 256 pages (1MB) per vcpu,
         # plus 1 page per MiB of RAM for the P2M map,
@@ -607,7 +618,7 @@ class X86_Linux_ImageHandler(LinuxImageH
     def buildDomain(self):
         # set physical mapping limit
         # add an 8MB slack to balance backend allocations.
-        mem_kb = self.getRequiredInitialReservation() + (8 * 1024)
+        mem_kb = self.getRequiredMaximumReservation() + (8 * 1024)
         xc.domain_set_memmap_limit(self.vm.getDomid(), mem_kb)
         return LinuxImageHandler.buildDomain(self)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.