mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[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> --HG-- extra : transplant_source : %09%80%DF%BA%E7F%80%5CQpNb%A1%BCF%03%CD%81PA
This commit is contained in:
1 parent
14e7af51af
commit
d22902b432
1 file changed
+14
-15
@@ -214,16 +214,24 @@ class LinuxImageHandler(ImageHandler):
|
||||
ramdisk = self.ramdisk,
|
||||
features = self.vm.getFeatures())
|
||||
|
||||
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(LinuxImageHandler):
|
||||
|
||||
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()
|
||||
console_evtchn = self.vm.getConsolePort()
|
||||
@@ -249,15 +257,6 @@ class PPC_ProseImageHandler(LinuxImageHandler):
|
||||
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):
|
||||
|
||||
ostype = "hvm"
|
||||
@@ -588,7 +587,7 @@ class X86_Linux_ImageHandler(LinuxImageHandler):
|
||||
|
||||
_handlers = {
|
||||
"powerpc": {
|
||||
"linux": LinuxImageHandler,
|
||||
"linux": PPC_LinuxImageHandler,
|
||||
"prose": PPC_ProseImageHandler,
|
||||
},
|
||||
"ia64": {
|
||||
|
||||