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] Rearrange restart logic so that a failure to restart a d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Rearrange restart logic so that a failure to restart a domain does not cause
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Nov 2005 03:38:07 +0000
Delivery-date: Tue, 08 Nov 2005 03:38:25 +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 eafd932231ae1316a7ed7b0a1655543bed050180
# Parent  f2202af6402347387ea2ee10d03742bcb67cefd5
Rearrange restart logic so that a failure to restart a domain does not cause
cascading secondary errors.  Fixes bug #384.

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

diff -r f2202af64023 -r eafd932231ae tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Nov  8 01:51:34 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Nov  8 02:07:57 2005
@@ -89,6 +89,8 @@
 
 """Minimum time between domain restarts in seconds."""
 MINIMUM_RESTART_TIME = 20
+
+RESTART_IN_PROGRESS = 'xend/restart_in_progress'
 
 
 xc = xen.lowlevel.xc.new()
@@ -1269,14 +1271,14 @@
 
         config = self.sxpr()
 
-        if self.readVm('xend/restart_in_progress'):
+        if self.readVm(RESTART_IN_PROGRESS):
             log.error('Xend failed during restart of domain %d.  '
                       'Refusing to restart to avoid loops.',
                       self.domid)
             self.destroy()
             return
 
-        self.writeVm('xend/restart_in_progress', 'True')
+        self.writeVm(RESTART_IN_PROGRESS, 'True')
 
         now = time.time()
         rst = self.readVm('xend/previous_restart_time')
@@ -1298,26 +1300,28 @@
                 self.preserveForRestart()
             else:
                 self.destroyDomain()
-                
+
+            # new_dom's VM will be the same as this domain's VM, except where
+            # the rename flag has instructed us to call preserveForRestart.
+            # In that case, it is important that we remove the
+            # RESTART_IN_PROGRESS node from the new domain, not the old one,
+            # once the new one is available.
+
+            new_dom = None
             try:
                 xd = get_component('xen.xend.XendDomain')
                 new_dom = xd.domain_create(config)
-                try:
-                    new_dom.unpause()
-                except:
+                new_dom.unpause()
+                new_dom.removeVm(RESTART_IN_PROGRESS)
+            except:
+                if new_dom:
+                    new_dom.removeVm(RESTART_IN_PROGRESS)
                     new_dom.destroy()
-                    raise
-            except:
-                log.exception('Failed to restart domain %d.', self.domid)
-        finally:
-            # new_dom's VM will be the same as this domain's VM, except where
-            # the rename flag has instructed us to call preserveForRestart.
-            # In that case, it is important that we use new_dom.removeVm, not
-            # self.removeVm.
-            new_dom.removeVm('xend/restart_in_progress')
-            
-        # self.configure_bootloader()
-        #        self.exportToDB()
+                else:
+                    self.removeVm(RESTART_IN_PROGRESS)
+                raise
+        except:
+            log.exception('Failed to restart domain %d.', self.domid)
 
 
     def preserveForRestart(self):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Rearrange restart logic so that a failure to restart a domain does not cause, Xen patchbot -unstable <=