WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] increase initial memory reservation for stubdom base

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] increase initial memory reservation for stubdom based HVM domains
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 15 Jan 2009 16:46:00 +0000
Delivery-date: Thu, 15 Jan 2009 08:47:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
Hi all,
this patch requests 32 additional MB of free RAM from dom0 when an HVM
domain is started, if the device model for the domain is provided by a
stubdom.
This way there is no risk that a stubdom fails to populate the videoram
because the RAM freed for the videoram by dom0 has already been used to
create the stubdom.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff -r 10a8fae412c5 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Jan 14 13:43:17 2009 +0000
+++ b/tools/python/xen/xend/image.py    Thu Jan 15 16:33:26 2009 +0000
@@ -838,6 +838,7 @@
         HVMImageHandler.configure(self, vmConfig)
         self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
         self.vramsize = int(vmConfig['platform'].get('videoram',4)) * 1024
+        self.use_stubdom = 
(vmConfig['platform'].get('device_model').find('stubdom-dm') >= 0)
 
     def buildDomain(self):
         xc.nvram_init(self.vm.getName(), self.vm.getDomid())
@@ -853,6 +854,8 @@
         extra_pages = 1024 + 5
         mem_kb += extra_pages * page_kb
         mem_kb += self.vramsize
+        if self.use_stubdom :
+            mem_kb += 32 * 1024 
         return mem_kb
 
     def getRequiredInitialReservation(self):
@@ -888,6 +891,7 @@
         HVMImageHandler.configure(self, vmConfig)
         self.pae = int(vmConfig['platform'].get('pae',  0))
         self.vramsize = int(vmConfig['platform'].get('videoram',4)) * 1024
+        self.use_stubdom = 
(vmConfig['platform'].get('device_model').find('stubdom-dm') >= 0)
 
     def buildDomain(self):
         xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_PAE_ENABLED, self.pae)
@@ -896,7 +900,10 @@
         return rc
 
     def getRequiredAvailableMemory(self, mem_kb):
-        return mem_kb + self.vramsize
+        mem_kb += self.vramsize
+        if self.use_stubdom :
+            mem_kb += 32 * 1024
+        return mem_kb
 
     def getRequiredInitialReservation(self):
         return self.vm.getMemoryTarget()

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