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] Added method so that SrvDaemon can be run in the foregro

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added method so that SrvDaemon can be run in the foreground without all the
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Nov 2005 16:16:08 +0000
Delivery-date: Mon, 21 Nov 2005 16:16:29 +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 3a544c04cc6171f857ffea93ca4aefc7a51c7d46
# Parent  d7b91e64bd4c84e9d123ed8efe45544a7a4fd667
Added method so that SrvDaemon can be run in the foreground without all the
forking implied by the start method.  This makes it easier to run valgrind
against Xend, or run it with a pydebug-compiled Python.

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

diff -r d7b91e64bd4c -r 3a544c04cc61 tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 21 11:42:47 2005
+++ b/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 21 11:44:43 2005
@@ -300,3 +300,25 @@
     except:
         inst = Daemon()
     return inst
+
+
+def main(argv = None):
+    global XEND_DAEMONIZE
+    
+    XEND_DAEMONIZE = 0
+    if argv is None:
+        argv = sys.argv
+
+    try:
+        daemon = instance()
+    
+        r,w = os.pipe()
+        daemon.run(os.fdopen(w, 'w'))
+        return 0
+    except Exception, exn:
+        log.fatal(exn)
+        return 1
+
+
+if __name__ == "__main__":
+    sys.exit(main())

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added method so that SrvDaemon can be run in the foreground without all the, Xen patchbot -unstable <=