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-changelog

[Xen-changelog] Catch RuntimeError inside initDomain, for better handlin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Catch RuntimeError inside initDomain, for better handling of out-of-memory, etc.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Nov 2005 16:16:11 +0000
Delivery-date: Mon, 21 Nov 2005 16:17:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 8fb11d28df0f7b33ae8c2f2c5869218df68b5f82
# Parent  c7a46ec8d4dfbe7d99bedc95c1e399c619db1d76
Catch RuntimeError inside initDomain, for better handling of out-of-memory, etc.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r c7a46ec8d4df -r 8fb11d28df0f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Nov 21 12:12:09 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Nov 21 12:13:57 2005
@@ -1098,36 +1098,40 @@
         if not self.infoIsSet('image'):
             raise VmError('Missing image in configuration')
 
-        self.image = image.create(self,
-                                  self.info['image'],
-                                  self.info['device'])
-
-        xc.domain_setcpuweight(self.domid, self.info['cpu_weight'])
-
-        m = self.image.getDomainMemory(self.info['memory'] * 1024)
-        xc.domain_setmaxmem(self.domid, maxmem_kb = m)
-        xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
-
-        cpu = self.info['cpu']
-        if cpu is not None and cpu != -1:
-            xc.domain_pincpu(self.domid, 0, 1 << cpu)
-
-        self.createChannels()
-
-        channel_details = self.image.createImage()
-
-        self.store_mfn = channel_details['store_mfn']
-        if 'console_mfn' in channel_details:
-            self.console_mfn = channel_details['console_mfn']
-
-        self.introduceDomain()
-
-        self.createDevices()
-
-        if self.info['bootloader']:
-            self.image.cleanupBootloading()
-
-        self.info['start_time'] = time.time()
+        try:
+            self.image = image.create(self,
+                                      self.info['image'],
+                                      self.info['device'])
+
+            xc.domain_setcpuweight(self.domid, self.info['cpu_weight'])
+
+            m = self.image.getDomainMemory(self.info['memory'] * 1024)
+            xc.domain_setmaxmem(self.domid, maxmem_kb = m)
+            xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
+
+            cpu = self.info['cpu']
+            if cpu is not None and cpu != -1:
+                xc.domain_pincpu(self.domid, 0, 1 << cpu)
+
+            self.createChannels()
+
+            channel_details = self.image.createImage()
+
+            self.store_mfn = channel_details['store_mfn']
+            if 'console_mfn' in channel_details:
+                self.console_mfn = channel_details['console_mfn']
+
+            self.introduceDomain()
+
+            self.createDevices()
+
+            if self.info['bootloader']:
+                self.image.cleanupBootloading()
+
+            self.info['start_time'] = time.time()
+
+        except RuntimeError, exn:
+            raise VmError(str(exn))
 
 
     ## public:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Catch RuntimeError inside initDomain, for better handling of out-of-memory, etc., Xen patchbot -unstable <=