]> git.proxmox.com Git - qemu.git/commit
vnc: fix "info vnc" with "-vnc ..., reverse=on"
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Oct 2012 12:30:58 +0000 (14:30 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 30 Nov 2012 21:38:14 +0000 (15:38 -0600)
commit5af7caaadd1d11c7f061c914e34a5d917015b733
treeeaa11425352025d28bb105020f6c8a1beadc6569
parent0ae18b369cbd7c8bae26193349878bab4c12c3d1
vnc: fix "info vnc" with "-vnc ..., reverse=on"

When reverse connection is in use, there is no active VNC server
socket.  Because of this, getsockopt(-1, ...) is attempted and
the following error is emitted:

    $ socat TCP-LISTEN:5900,reuseaddr TCP-LISTEN:5901,reuseaddr &
    $ x86_64-softmmu/qemu-system-x86_64 -vnc localhost:5900,reverse -monitor stdio
    QEMU 1.2.50 monitor - type 'help' for more information
    (qemu) info vnc
    An undefined error has occurred

Because however the host, family, service and auth fields are
optional, we can just exit if there is no active server socket.

    $ x86_64-softmmu/qemu-system-x86_64 -vnc localhost:5900,reverse -monitor stdio
    QEMU 1.2.50 monitor - type 'help' for more information
    (qemu) info vnc
    Server:
    Client:
         address: 127.0.0.1:5900
      x509_dname: none
        username: none

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 417b0b88904fe1dd8c41bff8092dfbab0134d9cb)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ui/vnc.c