ia64/xen-unstable

changeset 19020:f75567adad9b

xend: Fix a ssl migration hang issue

When another VM is started by xend, the spawned qemu process will keep
the p2cwrite file descriptor open.
Thus there will be two open descriptors associated with the write end
of the pipe. The read end of the pipe only sees EOF when the qemu
process has terminated.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 09 10:04:24 2009 +0000 (2009-01-09)
parents 67ffce500feb
children bf847041d98f
files tools/python/xen/util/oshelp.py tools/python/xen/xend/server/relocate.py
line diff
     1.1 --- a/tools/python/xen/util/oshelp.py	Thu Jan 08 16:59:21 2009 +0000
     1.2 +++ b/tools/python/xen/util/oshelp.py	Fri Jan 09 10:04:24 2009 +0000
     1.3 @@ -5,7 +5,7 @@ def fcntl_setfd_cloexec(file, bool):
     1.4          f = fcntl.fcntl(file, fcntl.F_GETFD)
     1.5          if bool: f |= fcntl.FD_CLOEXEC
     1.6          else: f &= ~fcntl.FD_CLOEXEC
     1.7 -        fcntl.fcntl(file, fcntl.F_SETFD)
     1.8 +        fcntl.fcntl(file, fcntl.F_SETFD, f)
     1.9  
    1.10  def waitstatus_description(st):
    1.11          if os.WIFEXITED(st):
     2.1 --- a/tools/python/xen/xend/server/relocate.py	Thu Jan 08 16:59:21 2009 +0000
     2.2 +++ b/tools/python/xen/xend/server/relocate.py	Fri Jan 09 10:04:24 2009 +0000
     2.3 @@ -122,6 +122,8 @@ class RelocationProtocol(protocol.Protoc
     2.4          if self.transport:
     2.5              self.send_reply(["ready", name])
     2.6              p2cread, p2cwrite = os.pipe()
     2.7 +            from xen.util import oshelp
     2.8 +            oshelp.fcntl_setfd_cloexec(p2cwrite, True)
     2.9              threading.Thread(target=connection.SSLSocketServerConnection.recv2fd,
    2.10                               args=(self.transport.sock, p2cwrite)).start()
    2.11              try: