diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-10 14:30:58 +0200 |
---|---|---|
committer | Doug Goldstein <cardoe@cardoe.com> | 2012-11-21 15:22:30 -0600 |
commit | c625b1377a341f9cd0045064b254f1d7daedbb3e (patch) | |
tree | bb1fcbba2ceb6f27507763451d7cab6679c4a5ac | |
parent | ui/vnc: Only report/use TIGHT_PNG encoding if enabled. (diff) | |
download | qemu-kvm-c625b1377a341f9cd0045064b254f1d7daedbb3e.tar.gz qemu-kvm-c625b1377a341f9cd0045064b254f1d7daedbb3e.tar.bz2 qemu-kvm-c625b1377a341f9cd0045064b254f1d7daedbb3e.zip |
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)
-rw-r--r-- | ui/vnc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -371,6 +371,10 @@ VncInfo *qmp_query_vnc(Error **errp) } } + if (vnc_display->lsock == -1) { + return info; + } + if (getsockname(vnc_display->lsock, (struct sockaddr *)&sa, &salen) == -1) { error_set(errp, QERR_UNDEFINED_ERROR); |