From 1a751ebfbb2d7a696b889d8208cb5ffc83c090b1 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 27 Mar 2013 10:10:45 +0100 Subject: 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 Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- util/qemu-sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index b632a740ab..94581aa236 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -910,6 +910,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; -- cgit v1.2.1