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] xend: make domain restart thread singleton

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xend: make domain restart thread singleton
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 15 Apr 2009 17:41:18 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 15 Apr 2009 01:41:51 -0700
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
I observed from xend.log that several domain restart threads run
simultaneously. This patch make it singleton.
Without this, several coredump of a domain might be created.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 120d3c67951b tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Apr 10 06:58:04 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 15 17:00:54 2009 +0900
@@ -350,6 +350,8 @@ class XendDomainInfo:
     @type shutdownWatch: xen.xend.xenstore.xswatch
     @ivar shutdownStartTime: UNIX Time when domain started shutting down.
     @type shutdownStartTime: float or None
+    @ivar restart_in_progress: Is a domain restart thread running?
+    @type restart_in_progress: bool
 #    @ivar state: Domain state
 #    @type state: enum(DOM_STATE_HALTED, DOM_STATE_RUNNING, ...)
     @ivar state_updated: lock for self.state
@@ -418,6 +420,7 @@ class XendDomainInfo:
         self.shutdownWatch = None
         self.shutdownStartTime = None
         self._resume = resume
+        self.restart_in_progress = False
 
         self.state_updated = threading.Condition()
         self.refresh_shutdown_lock = threading.Condition()
@@ -1930,7 +1933,8 @@ class XendDomainInfo:
         finally:
             self.refresh_shutdown_lock.release()
 
-        if restart_reason:
+        if restart_reason and not self.restart_in_progress:
+            self.restart_in_progress = True
             threading.Thread(target = self._maybeRestart,
                              args = (restart_reason,)).start()
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xend: make domain restart thread singleton, Kouya Shimura <=