diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-05-03 11:22:58 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-05-03 11:22:58 +0100 |
commit | 0d03dd60a12a1af5d828864844dba3055418969f (patch) | |
tree | fdb2ef3a06e1605b88cc0a744dd425d8fa6f30d3 | |
parent | 320061b18ef5a31bb7b5a8f84ae2bf2ab0d54b66 (diff) | |
download | xen-0d03dd60a12a1af5d828864844dba3055418969f.tar.gz xen-0d03dd60a12a1af5d828864844dba3055418969f.tar.bz2 xen-0d03dd60a12a1af5d828864844dba3055418969f.zip |
xend: Revert changeset 15002. Breaks xend restart in some cases.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | tools/python/xen/xend/server/SrvDaemon.py | 2 | ||||
-rw-r--r-- | tools/python/xen/xend/server/SrvServer.py | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/python/xen/xend/server/SrvDaemon.py b/tools/python/xen/xend/server/SrvDaemon.py index ccb485d1fb..a265aef906 100644 --- a/tools/python/xen/xend/server/SrvDaemon.py +++ b/tools/python/xen/xend/server/SrvDaemon.py @@ -342,7 +342,7 @@ class Daemon: log.info("Xend version: Unknown.") relocate.listenRelocation() - servers = SrvServer.create(status) + servers = SrvServer.create() servers.start(status) del servers diff --git a/tools/python/xen/xend/server/SrvServer.py b/tools/python/xen/xend/server/SrvServer.py index 544be9725d..10a09a4c56 100644 --- a/tools/python/xen/xend/server/SrvServer.py +++ b/tools/python/xen/xend/server/SrvServer.py @@ -95,6 +95,14 @@ class XendServers: self.cleanup(signum, frame, reloading = True) def start(self, status): + # Running the network script will spawn another process, which takes + # the status fd with it unless we set FD_CLOEXEC. Failing to do this + # causes the read in SrvDaemon to hang even when we have written here. + if status: + fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC) + + Vifctl.network('start') + # Prepare to catch SIGTERM (received when 'xend stop' is executed) # and call each server's cleanup if possible signal.signal(signal.SIGTERM, self.cleanup) @@ -241,15 +249,7 @@ def _loadConfig(servers, root, reload): servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False)) -def create(status): - # Running the network script will spawn another process, which takes - # the status fd with it unless we set FD_CLOEXEC. Failing to do this - # causes the read in SrvDaemon to hang even when we have written here. - if status: - fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC) - - Vifctl.network('start') - +def create(): root = SrvDir() root.putChild('xend', SrvRoot()) servers = XendServers(root) |