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>
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):
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: