diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-01-09 10:04:24 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-01-09 10:04:24 +0000 |
commit | a562362b254994095dafec4b5ded07d458cf19cd (patch) | |
tree | d97c9fec292850fa7a8afc6953059e20ebbe4296 /tools | |
parent | e3a9e577ae1e3aed1e537e436c3930b54de932aa (diff) | |
download | xen-a562362b254994095dafec4b5ded07d458cf19cd.tar.gz xen-a562362b254994095dafec4b5ded07d458cf19cd.tar.bz2 xen-a562362b254994095dafec4b5ded07d458cf19cd.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/util/oshelp.py | 2 | ||||
-rw-r--r-- | tools/python/xen/xend/server/relocate.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tools/python/xen/util/oshelp.py b/tools/python/xen/util/oshelp.py index b5a0a2a371..3efc43d57f 100644 --- a/tools/python/xen/util/oshelp.py +++ b/tools/python/xen/util/oshelp.py @@ -5,7 +5,7 @@ def fcntl_setfd_cloexec(file, bool): f = fcntl.fcntl(file, fcntl.F_GETFD) if bool: f |= fcntl.FD_CLOEXEC else: f &= ~fcntl.FD_CLOEXEC - fcntl.fcntl(file, fcntl.F_SETFD) + fcntl.fcntl(file, fcntl.F_SETFD, f) def waitstatus_description(st): if os.WIFEXITED(st): diff --git a/tools/python/xen/xend/server/relocate.py b/tools/python/xen/xend/server/relocate.py index 007884b46a..6aa6f83d40 100644 --- a/tools/python/xen/xend/server/relocate.py +++ b/tools/python/xen/xend/server/relocate.py @@ -122,6 +122,8 @@ class RelocationProtocol(protocol.Protocol): if self.transport: self.send_reply(["ready", name]) p2cread, p2cwrite = os.pipe() + from xen.util import oshelp + oshelp.fcntl_setfd_cloexec(p2cwrite, True) threading.Thread(target=connection.SSLSocketServerConnection.recv2fd, args=(self.transport.sock, p2cwrite)).start() try: |