Cleanups to tools since HVM domain P2M table and 1-1 table are built in xen.

Signed-off-by: Xin Li <xin.b.li@intel.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-02-21 18:23:35 +01:00
1 parent c32f3b529c
commit 911d50521b
3 files changed
+12 -42

No files matched your search

+4 -20
View File
@@ -383,28 +383,12 @@ class HVMImageHandler(ImageHandler):
def getDomainMemory(self, mem):
"""@see ImageHandler.getDomainMemory"""
page_kb = 4
extra_pages = 0
if os.uname()[4] == 'ia64':
page_kb = 16
# for ioreq_t and xenstore
static_pages = 2
return mem + (self.getPageTableSize(mem / 1024) + static_pages) * page_kb
def getPageTableSize(self, mem_mb):
"""Return the pages of memory needed for 1:1 page tables for physical
mode.
@param mem_mb: size in MB
@return size in KB
"""
# 1 page for the PGD + 1 pte page for 4MB of memory (rounded)
if os.uname()[4] == 'x86_64':
return 5 + ((mem_mb + 1) >> 1)
elif os.uname()[4] == 'ia64':
# 1:1 pgtable is allocated on demand ia64, so just return rom size
# for guest firmware
return 1024
else:
return 1 + ((mem_mb + 3) >> 2)
# ROM size for guest firmware
extra_pages = 1024
return mem + extra_pages * page_kb
def register_shutdown_watch(self):
""" add xen store watch on control/shutdown """
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.