summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-04-04 16:18:30 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-04-04 15:17:32 -0500
commit283b7de6a57ff96db89d46874cfdb6fc590760dc (patch)
tree7d311766ccf4b42e85af4b9dcd4f95f8dd1ef493
parenta1cb89f3fedd6206bc1d99744f303afad2fa6dee (diff)
downloadqemu-283b7de6a57ff96db89d46874cfdb6fc590760dc.tar.gz
qemu-socket: set passed fd non-blocking in socket_connect()
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 <stefanha@redhat.com> (cherry picked from commit 35fb94fa292173a3e1df0768433e06912a2a88e4) Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--util/qemu-sockets.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index e92e0d568a..cd54fb4af7 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;