diff options
author | Cole Robinson | 2015-05-05 17:07:17 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2015-05-20 10:23:08 +0200 |
commit | 3d00ac1a2ee0294fc3d460e6013a5cdd9c73ea6c (patch) | |
tree | 200ae6619a489658e142ed751f60ee3c4a41d74c /ui | |
parent | ui: remove check for failure of qemu_acl_init() (diff) | |
download | qemu-3d00ac1a2ee0294fc3d460e6013a5cdd9c73ea6c.tar.gz qemu-3d00ac1a2ee0294fc3d460e6013a5cdd9c73ea6c.tar.xz qemu-3d00ac1a2ee0294fc3d460e6013a5cdd9c73ea6c.zip |
vnc: Don't assert if opening unix socket fails
Reproducer:
$ qemu-system-x86_64 -display vnc=unix:/root/i-cant-access-you.sock
qemu-system-x86_64: iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed.
Aborted (core dumped)
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/vnc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3684,6 +3684,9 @@ void vnc_display_open(const char *id, Error **errp) /* listen for connects */ if (strncmp(vnc, "unix:", 5) == 0) { vs->lsock = unix_listen(vnc+5, NULL, 0, errp); + if (vs->lsock < 0) { + goto fail; + } vs->is_unix = true; } else { vs->lsock = inet_listen_opts(sopts, 5900, errp); |