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>
This commit is contained in:
Gerd Hoffmann 2013-06-24 08:39:46 +02:00 committed by Michael Tokarev
parent c1204afc7c
commit d1ec72a44e
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}