[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH stable-1.4 v2 3/4] qemu-socket: set passed fd non-bl
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH stable-1.4 v2 3/4] qemu-socket: set passed fd non-blocking in socket_connect() |
Date: |
Thu, 4 Apr 2013 16:18:30 +0200 |
socket_connect() sets non-blocking on TCP or UNIX domain sockets if a
callback function is passed. Do the same for file descriptor passing,
otherwise we could unexpectedly be using a blocking file descriptor.
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit 35fb94fa292173a3e1df0768433e06912a2a88e4)
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
util/qemu-sockets.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index e92e0d5..cd54fb4 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -906,6 +906,7 @@ int socket_connect(SocketAddress *addr, Error **errp,
case SOCKET_ADDRESS_KIND_FD:
fd = monitor_get_fd(cur_mon, addr->fd->str, errp);
if (callback) {
+ qemu_set_nonblock(fd);
callback(fd, opaque);
}
break;
--
1.8.1.4
- [Qemu-devel] [PATCH stable-1.4 v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, Stefan Hajnoczi, 2013/04/04
- [Qemu-devel] [PATCH stable-1.4 v2 3/4] qemu-socket: set passed fd non-blocking in socket_connect(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH stable-1.4 v2 2/4] net: ensure "socket" backend uses non-blocking fds, Stefan Hajnoczi, 2013/04/04
- [Qemu-devel] [PATCH stable-1.4 v2 4/4] chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors, Stefan Hajnoczi, 2013/04/04
- [Qemu-devel] [PATCH stable-1.4 v2 1/4] oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock(), Stefan Hajnoczi, 2013/04/04
- Re: [Qemu-devel] [PATCH stable-1.4 v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, Eric Blake, 2013/04/04
- Re: [Qemu-devel] [PATCH stable-1.4 v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, Luiz Capitulino, 2013/04/04
- Re: [Qemu-devel] [PATCH stable-1.4 v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, mdroth, 2013/04/04