aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-06-24 08:39:46 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2013-06-28 22:10:33 +0400
commitd1ec72a44e0a167f9e8254d6d1098d27f104571f (patch)
tree8183571cb355533cf083c30ec77b242948e5b23a /util
parentc1204afc7c048cf58b0a8f1c11886f36ca73ef28 (diff)
qemu-socket: catch monitor_get_fd failures
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-sockets.c2
1 files changed, 1 insertions, 1 deletions
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);
}