# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 0980dfbae746805c51704e62a1bc4603cd815041
# Parent  ea0c006faab68d2c2a65750c90ec8881f0e0b003
[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 <[EMAIL PROTECTED]>
Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 tools/python/xen/xend/image.py |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff -r ea0c006faab6 -r 0980dfbae746 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Tue Jan 23 08:54:41 2007 -0600
+++ b/tools/python/xen/xend/image.py    Thu Jan 25 15:55:25 2007 -0500
@@ -214,15 +214,23 @@ class LinuxImageHandler(ImageHandler):
                               ramdisk        = self.ramdisk,
                               features       = self.vm.getFeatures())
 
-
-
-class PPC_ProseImageHandler(LinuxImageHandler):
+class PPC_LinuxImageHandler(LinuxImageHandler):
+
+    ostype = "linux"
+    
+    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
+        """@param shadow_mem_kb The configured shadow memory, in KiB.
+        @param maxmem_kb The configured maxmem, in KiB.
+        @return The corresponding required amount of shadow memory, also in
+        KiB.
+        PowerPC currently uses "shadow memory" to refer to the hash table."""
+        return max(maxmem_kb / 64, shadow_mem_kb)
+
+
+
+class PPC_ProseImageHandler(PPC_LinuxImageHandler):
 
     ostype = "prose"
-
-    def configure(self, vmConfig, imageConfig, deviceConfig):
-        LinuxImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
-        self.imageConfig = imageConfig
 
     def buildDomain(self):
         store_evtchn = self.vm.getStorePort()
@@ -248,15 +256,6 @@ class PPC_ProseImageHandler(LinuxImageHa
                                    cmdline        = self.cmdline,
                                    ramdisk        = self.ramdisk,
                                    features       = self.vm.getFeatures())
-
-    def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
-        """@param shadow_mem_kb The configured shadow memory, in KiB.
-        @param maxmem_kb The configured maxmem, in KiB.
-        @return The corresponding required amount of shadow memory, also in
-        KiB.
-        PowerPC currently uses "shadow memory" to refer to the hash table."""
-        return max(maxmem_kb / 64, shadow_mem_kb)
-
 
 class HVMImageHandler(ImageHandler):
 
@@ -598,7 +597,7 @@ class X86_Linux_ImageHandler(LinuxImageH
 
 _handlers = {
     "powerpc": {
-        "linux": LinuxImageHandler,
+        "linux": PPC_LinuxImageHandler,
         "prose": PPC_ProseImageHandler,
     },
     "ia64": {

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

Reply via email to