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] add videoram to stubdom initial memory reservation

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] add videoram to stubdom initial memory reservation
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 29 Jan 2009 16:26:58 +0000
Delivery-date: Thu, 29 Jan 2009 08:36:05 -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)
This patch adds a videoram parameter (4MB is the default) to pv guests
too: if the pv guest is actually a stubdomain then the videoram size is
added to the initial required available memory.
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 40d9d9ff435a stubdom/stubdom-dm
--- a/stubdom/stubdom-dm        Thu Jan 15 12:54:31 2009 +0000
+++ b/stubdom/stubdom-dm        Thu Jan 29 15:36:02 2009 +0000
@@ -15,6 +15,7 @@
 vncviewer=0
 vncpid=
 extra=
+videoram=4
 while [ "$#" -gt 0 ];
 do
     if [ "$#" -ge 2 ];
@@ -38,6 +39,10 @@
                 extra="$extra -loadvm $2";
                 shift
                 ;;
+           -videoram)
+               videoram="$2"
+               shift
+               ;;
        esac
     fi
     case "$1" in
@@ -72,7 +77,7 @@
        sleep 1
 done
 
-creation="xm create -c $domname-dm target=$domid memory=32 extra=\"$extra\""
+creation="xm create -c $domname-dm target=$domid memory=32 videoram=$videoram 
extra=\"$extra\""
 
 (while true ; do sleep 60 ; done) | /bin/sh -c "$creation" &
 #xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to 
shut down ; read" &
diff -r 40d9d9ff435a tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Thu Jan 15 12:54:31 2009 +0000
+++ b/tools/python/xen/xend/image.py    Thu Jan 29 15:36:02 2009 +0000
@@ -633,6 +633,8 @@
 
     def configure(self, vmConfig):
         ImageHandler.configure(self, vmConfig)
+        self.vramsize = int(vmConfig['platform'].get('videoram',4)) * 1024
+        self.is_stubdom = (self.kernel.find('stubdom') >= 0)
 
     def buildDomain(self):
         store_evtchn = self.vm.getStorePort()
@@ -663,6 +665,17 @@
                               features       = self.vm.getFeatures(),
                               flags          = self.flags,
                               vhpt           = self.vhpt)
+
+    def getRequiredAvailableMemory(self, mem_kb):
+        if self.is_stubdom :
+            mem_kb += self.vramsize
+        return mem_kb
+
+    def getRequiredInitialReservation(self):
+        return self.vm.getMemoryTarget()
+
+    def getRequiredMaximumReservation(self):
+        return self.vm.getMemoryMaximum()
 
     def parseDeviceModelArgs(self, vmConfig):
         ret = ImageHandler.parseDeviceModelArgs(self, vmConfig)
diff -r 40d9d9ff435a tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Thu Jan 15 12:54:31 2009 +0000
+++ b/tools/python/xen/xm/create.py     Thu Jan 29 15:36:02 2009 +0000
@@ -635,6 +635,8 @@
     if vals.root:
         cmdline_root = strip('root=', vals.root)
         config_image.append(['root', cmdline_root])
+    if vals.videoram:
+        config_image.append(['videoram', vals.videoram])
     if vals.extra:
         config_image.append(['args', vals.extra])
 
@@ -884,7 +886,7 @@
     """Create the config for HVM devices.
     """
     args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb', 
'timer_mode',
-             'localtime', 'serial', 'stdvga', 'videoram', 'isa', 'nographic', 
'soundhw',
+             'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
              'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] add videoram to stubdom initial memory reservation, Stefano Stabellini <=