From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/8] ui: fix regression handling bare 'websocket' option to -vnc
Date: Tue, 24 Jan 2017 09:53:25 +0000 [thread overview]
Message-ID: <20170124095332.23955-2-berrange@redhat.com> (raw)
In-Reply-To: <20170124095332.23955-1-berrange@redhat.com>
The -vnc argument is documented as accepting two syntaxes for
the 'websocket' option, either a bare option name, or a port
number. If using the bare option name, it is supposed to apply
the display number as an offset to base port 5700. e.g.
-vnc localhost:3,websocket
should listen on port 5703, however, this was broken in 2.3.0 since
commit 4db14629c38611061fc19ec6927405923de84f08
Author: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue Sep 16 12:33:03 2014 +0200
vnc: switch to QemuOpts, allow multiple servers
instead qemu tries to listen on port "on" which gets looked up in
/etc/services and fails.
Fixes bug: #1455912
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
ui/vnc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 29aa9c4..c82e476 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3586,7 +3586,13 @@ void vnc_display_open(const char *id, Error **errp)
wsaddr->type = SOCKET_ADDRESS_KIND_INET;
inet = wsaddr->u.inet.data = g_new0(InetSocketAddress, 1);
inet->host = g_strdup(saddr->u.inet.data->host);
- inet->port = g_strdup(websocket);
+ if (g_str_equal(websocket, "") ||
+ g_str_equal(websocket, "on")) {
+ inet->port = g_strdup_printf(
+ "%d", (int)baseport + 5700);
+ } else {
+ inet->port = g_strdup(websocket);
+ }
if (to) {
inet->has_to = true;
--
2.9.3
next prev parent reply other threads:[~2017-01-24 9:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 9:53 [Qemu-devel] [PATCH v2 0/8] Support multiple listening sockets per VNC server Daniel P. Berrange
2017-01-24 9:53 ` Daniel P. Berrange [this message]
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 2/8] ui: fix reporting of VNC auth in query-vnc-servers Daniel P. Berrange
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 3/8] ui: refactor VncDisplay to allow multiple listening sockets Daniel P. Berrange
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 4/8] ui: refactor code for populating SocketAddress from vnc_display_open Daniel P. Berrange
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 5/8] ui: extract code to connect/listen " Daniel P. Berrange
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 6/8] ui: let VNC server listen on all resolved IP addresses Daniel P. Berrange
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 7/8] util: add iterators for QemuOpts values Daniel P. Berrange
2017-01-24 18:58 ` Eric Blake
2017-01-24 9:53 ` [Qemu-devel] [PATCH v2 8/8] ui: add ability to specify multiple VNC listen addresses Daniel P. Berrange
2017-01-24 19:15 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170124095332.23955-2-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).