ia64/xen-unstable

changeset 13942:54530b945067

[XEN][XEND][POWERPC] Don't ignore shadow memory requirement
We don't need a custom buildDomain() anymore but we do need to provide a
shadow memory calculation.

- Create PPC_LinuxImageHandler class to implement
getRequiredShadowMemory().
- Derive prose builder from PPC_LinuxImageHandlerClass.
- Drop configure() as it is not needed according to Jimi.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Thu Jan 25 15:55:25 2007 -0500 (2007-01-25)
parents b071a2610abc
children 4ce0b332b572
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Tue Jan 23 08:54:41 2007 -0600
     1.2 +++ b/tools/python/xen/xend/image.py	Thu Jan 25 15:55:25 2007 -0500
     1.3 @@ -214,16 +214,24 @@ class LinuxImageHandler(ImageHandler):
     1.4                                ramdisk        = self.ramdisk,
     1.5                                features       = self.vm.getFeatures())
     1.6  
     1.7 +class PPC_LinuxImageHandler(LinuxImageHandler):
     1.8 +
     1.9 +    ostype = "linux"
    1.10 +    
    1.11 +    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
    1.12 +        """@param shadow_mem_kb The configured shadow memory, in KiB.
    1.13 +        @param maxmem_kb The configured maxmem, in KiB.
    1.14 +        @return The corresponding required amount of shadow memory, also in
    1.15 +        KiB.
    1.16 +        PowerPC currently uses "shadow memory" to refer to the hash table."""
    1.17 +        return max(maxmem_kb / 64, shadow_mem_kb)
    1.18  
    1.19  
    1.20 -class PPC_ProseImageHandler(LinuxImageHandler):
    1.21 +
    1.22 +class PPC_ProseImageHandler(PPC_LinuxImageHandler):
    1.23  
    1.24      ostype = "prose"
    1.25  
    1.26 -    def configure(self, vmConfig, imageConfig, deviceConfig):
    1.27 -        LinuxImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
    1.28 -        self.imageConfig = imageConfig
    1.29 -
    1.30      def buildDomain(self):
    1.31          store_evtchn = self.vm.getStorePort()
    1.32          console_evtchn = self.vm.getConsolePort()
    1.33 @@ -249,15 +257,6 @@ class PPC_ProseImageHandler(LinuxImageHa
    1.34                                     ramdisk        = self.ramdisk,
    1.35                                     features       = self.vm.getFeatures())
    1.36  
    1.37 -    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
    1.38 -        """@param shadow_mem_kb The configured shadow memory, in KiB.
    1.39 -        @param maxmem_kb The configured maxmem, in KiB.
    1.40 -        @return The corresponding required amount of shadow memory, also in
    1.41 -        KiB.
    1.42 -        PowerPC currently uses "shadow memory" to refer to the hash table."""
    1.43 -        return max(maxmem_kb / 64, shadow_mem_kb)
    1.44 -
    1.45 -
    1.46  class HVMImageHandler(ImageHandler):
    1.47  
    1.48      ostype = "hvm"
    1.49 @@ -588,7 +587,7 @@ class X86_Linux_ImageHandler(LinuxImageH
    1.50  
    1.51  _handlers = {
    1.52      "powerpc": {
    1.53 -        "linux": LinuxImageHandler,
    1.54 +        "linux": PPC_LinuxImageHandler,
    1.55          "prose": PPC_ProseImageHandler,
    1.56      },
    1.57      "ia64": {