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] [xen-unstable] Fix server reloading when the HTTP server

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix server reloading when the HTTP server is enabled.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 Dec 2006 22:10:18 +0000
Delivery-date: Wed, 06 Dec 2006 14:09:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID c4824dcd57c4dc9f8e9f25248b9d6d7ac7b59cfa
# Parent  258722281202ae3aec98e970caf331888d03496b
Fix server reloading when the HTTP server is enabled.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/server/SrvServer.py |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff -r 258722281202 -r c4824dcd57c4 tools/python/xen/xend/server/SrvServer.py
--- a/tools/python/xen/xend/server/SrvServer.py Wed Dec 06 10:13:46 2006 +0000
+++ b/tools/python/xen/xend/server/SrvServer.py Wed Dec 06 10:37:10 2006 +0000
@@ -62,8 +62,9 @@ xroot = XendRoot.instance()
 
 class XendServers:
 
-    def __init__(self):
+    def __init__(self, root):
         self.servers = []
+        self.root = root
         self.cleaningUp = False
         self.reloadingConfig = False
 
@@ -101,6 +102,9 @@ class XendServers:
         while True:
             threads = []
             for server in self.servers:
+                if server.ready:
+                    continue
+
                 thread = Thread(target=server.run, 
name=server.__class__.__name__)
                 if isinstance(server, HttpServer):
                     thread.setDaemon(True)
@@ -156,21 +160,23 @@ class XendServers:
                     pass
 
             if self.reloadingConfig:
-                log.info("Restarting all servers...")
+                log.info("Restarting all XML-RPC and Xen-API servers...")
                 self.cleaningUp = False
                 self.reloadingConfig = False
                 xroot.set_config()
-                self.servers = []
-                _loadConfig(self)
+                new_servers = [x for x in self.servers
+                               if isinstance(x, HttpServer)]
+                self.servers = new_servers
+                _loadConfig(self, self.root, True)
             else:
                 break
 
-def _loadConfig(servers, root):
-    if xroot.get_xend_http_server():
+def _loadConfig(servers, root, reload):
+    if not reload and xroot.get_xend_http_server():
         servers.add(HttpServer(root,
                                xroot.get_xend_address(),
                                xroot.get_xend_port()))
-    if xroot.get_xend_unix_server():
+    if not reload and xroot.get_xend_unix_server():
         path = xroot.get_xend_unix_path()
         log.info('unix path=' + path)
         servers.add(UnixHttpServer(root, path))
@@ -218,6 +224,6 @@ def create():
 def create():
     root = SrvDir()
     root.putChild('xend', SrvRoot())
-    servers = XendServers()
-    _loadConfig(servers, root)
+    servers = XendServers(root)
+    _loadConfig(servers, root, False)
     return servers

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix server reloading when the HTTP server is enabled., Xen patchbot-unstable <=