mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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@xensource.com>
This commit is contained in:
1 parent
0858255f54
commit
8c4aff7e06
1 file changed
+22
@@ -300,3 +300,25 @@ def instance():
|
||||
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())
|
||||