From d1ec72a44e0a167f9e8254d6d1098d27f104571f Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 24 Jun 2013 08:39:46 +0200 Subject: [PATCH] qemu-socket: catch monitor_get_fd failures Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- util/qemu-sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 35023a8a92..126cbb603b 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -903,7 +903,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) { + if (fd >= 0 && callback) { qemu_set_nonblock(fd); callback(fd, opaque); } -- 2.34.1