direct-io.hg

changeset 15007:c857bf38f015

xend: Revert changeset 15002. Breaks xend restart in some cases.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu May 03 11:22:58 2007 +0100 (2007-05-03)
parents 24f47ff4fb25
children 623a07dda15c 2b653a785fb8
files tools/python/xen/xend/server/SrvDaemon.py tools/python/xen/xend/server/SrvServer.py
line diff
     1.1 --- a/tools/python/xen/xend/server/SrvDaemon.py	Thu May 03 09:33:12 2007 +0100
     1.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py	Thu May 03 11:22:58 2007 +0100
     1.3 @@ -342,7 +342,7 @@ class Daemon:
     1.4                  log.info("Xend version: Unknown.")
     1.5  
     1.6              relocate.listenRelocation()
     1.7 -            servers = SrvServer.create(status)
     1.8 +            servers = SrvServer.create()
     1.9              servers.start(status)
    1.10              del servers
    1.11              
     2.1 --- a/tools/python/xen/xend/server/SrvServer.py	Thu May 03 09:33:12 2007 +0100
     2.2 +++ b/tools/python/xen/xend/server/SrvServer.py	Thu May 03 11:22:58 2007 +0100
     2.3 @@ -95,6 +95,14 @@ class XendServers:
     2.4          self.cleanup(signum, frame, reloading = True)
     2.5  
     2.6      def start(self, status):
     2.7 +        # Running the network script will spawn another process, which takes
     2.8 +        # the status fd with it unless we set FD_CLOEXEC.  Failing to do this
     2.9 +        # causes the read in SrvDaemon to hang even when we have written here.
    2.10 +        if status:
    2.11 +            fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
    2.12 +        
    2.13 +        Vifctl.network('start')
    2.14 +
    2.15          # Prepare to catch SIGTERM (received when 'xend stop' is executed)
    2.16          # and call each server's cleanup if possible
    2.17          signal.signal(signal.SIGTERM, self.cleanup)
    2.18 @@ -241,15 +249,7 @@ def _loadConfig(servers, root, reload):
    2.19          servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))
    2.20  
    2.21  
    2.22 -def create(status):
    2.23 -    # Running the network script will spawn another process, which takes
    2.24 -    # the status fd with it unless we set FD_CLOEXEC.  Failing to do this
    2.25 -    # causes the read in SrvDaemon to hang even when we have written here.
    2.26 -    if status:
    2.27 -        fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
    2.28 -    
    2.29 -    Vifctl.network('start')
    2.30 -
    2.31 +def create():
    2.32      root = SrvDir()
    2.33      root.putChild('xend', SrvRoot())
    2.34      servers = XendServers(root)