Commit 3d00ac1a authored by Cole Robinson's avatar Cole Robinson Committed by Gerd Hoffmann
Browse files

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: default avatarCole Robinson <crobinso@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 2b2c1a38
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);