ia64/xen-unstable

changeset 11430:0419253c81de

Fix inverted sense of getRequiredAvailableMemory and
getRequiredInitialReservation on x86 HVM.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Sep 05 16:23:11 2006 +0100 (2006-09-05)
parents 323a89a3c01c
children e76c6d838a44
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Tue Sep 05 15:35:42 2006 +0100
     1.2 +++ b/tools/python/xen/xend/image.py	Tue Sep 05 16:23:11 2006 +0100
     1.3 @@ -448,6 +448,10 @@ class X86_HVM_ImageHandler(HVMImageHandl
     1.4      ostype = "hvm"
     1.5  
     1.6      def getRequiredAvailableMemory(self, mem_kb):
     1.7 +        # Add 8 MiB overhead for QEMU's video RAM.
     1.8 +        return self.getRequiredInitialReservation(mem_kb) + 8192
     1.9 +
    1.10 +    def getRequiredInitialReservation(self, mem_kb):
    1.11          page_kb = 4
    1.12          # This was derived emperically:
    1.13          #   2.4 MB overhead per 1024 MB RAM
    1.14 @@ -456,14 +460,10 @@ class X86_HVM_ImageHandler(HVMImageHandl
    1.15          extra_pages = int( math.ceil( extra_mb*1024 / page_kb ))
    1.16          return mem_kb + extra_pages * page_kb
    1.17  
    1.18 -    def getRequiredInitialReservation(self, mem_kb):
    1.19 -        # Add 8 MiB overhead for QEMU's video RAM.
    1.20 -        return self.getRequiredAvailableMemory(mem_kb) + 8192
    1.21 -
    1.22      def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
    1.23          # The given value is the configured value -- we need to include the
    1.24 -        # overhead due to getRequiredMemory.
    1.25 -        maxmem_kb = self.getRequiredMemory(maxmem_kb)
    1.26 +        # overhead due to getRequiredInitialReservation.
    1.27 +        maxmem_kb = self.getRequiredInitialReservation(maxmem_kb)
    1.28  
    1.29          # 1MB per vcpu plus 4Kib/Mib of RAM.  This is higher than 
    1.30          # the minimum that Xen would allocate if no value were given.