[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: Fix a ssl migration hang issue



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1231495464 0
# Node ID f75567adad9bc2d47a075f44c9f13e18961b62ef
# Parent  67ffce500feb0c815404b5d25ab8ff9472c8e9e3
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@xxxxxxxxxx>
---
 tools/python/xen/util/oshelp.py          |    2 +-
 tools/python/xen/xend/server/relocate.py |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff -r 67ffce500feb -r f75567adad9b tools/python/xen/util/oshelp.py
--- a/tools/python/xen/util/oshelp.py   Thu Jan 08 16:59:21 2009 +0000
+++ b/tools/python/xen/util/oshelp.py   Fri Jan 09 10:04:24 2009 +0000
@@ -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 -r 67ffce500feb -r f75567adad9b tools/python/xen/xend/server/relocate.py
--- a/tools/python/xen/xend/server/relocate.py  Thu Jan 08 16:59:21 2009 +0000
+++ b/tools/python/xen/xend/server/relocate.py  Fri Jan 09 10:04:24 2009 +0000
@@ -122,6 +122,8 @@ class RelocationProtocol(protocol.Protoc
         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:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.