From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Ján Tomko" <jtomko@redhat.com>, "Gerd Hoffmann" <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 1/5] Strip brackets from vnc host
Date: Wed, 20 May 2015 10:34:09 +0200 [thread overview]
Message-ID: <1432110853-11399-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1432110853-11399-1-git-send-email-kraxel@redhat.com>
From: Ján Tomko <jtomko@redhat.com>
Commit v2.2.0-1530-ge556032 vnc: switch to inet_listen_opts
bypassed the use of inet_parse in inet_listen, making literal
IPv6 addresses enclosed in brackets fail:
qemu-kvm: -vnc [::1]:0: Failed to start VNC server on `(null)': address
resolution failed for [::1]:5900: Name or service not known
Strip the brackets to make it work again.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/vnc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 9f8ecd0..2dccae9 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3482,7 +3482,14 @@ void vnc_display_open(const char *id, Error **errp)
h = strrchr(vnc, ':');
if (h) {
- char *host = g_strndup(vnc, h - vnc);
+ char *host;
+ size_t hlen = h - vnc;
+
+ if (vnc[0] == '[' && vnc[hlen - 1] == ']') {
+ host = g_strndup(vnc + 1, hlen - 2);
+ } else {
+ host = g_strndup(vnc, hlen);
+ }
qemu_opt_set(sopts, "host", host, &error_abort);
qemu_opt_set(wsopts, "host", host, &error_abort);
qemu_opt_set(sopts, "port", h+1, &error_abort);
--
1.8.3.1
next prev parent reply other threads:[~2015-05-20 8:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 8:34 [Qemu-devel] [PULL 0/5] vnc patch queue Gerd Hoffmann
2015-05-20 8:34 ` Gerd Hoffmann [this message]
2015-05-20 8:34 ` [Qemu-devel] [PULL 2/5] ui: remove check for failure of qemu_acl_init() Gerd Hoffmann
2015-05-20 8:34 ` [Qemu-devel] [PULL 3/5] vnc: Don't assert if opening unix socket fails Gerd Hoffmann
2015-05-20 8:34 ` [Qemu-devel] [PULL 4/5] vnc: Tweak error when init fails Gerd Hoffmann
2015-05-20 8:34 ` [Qemu-devel] [PULL 5/5] qemu-sockets: Report explicit error if unlink fails Gerd Hoffmann
2015-05-21 9:24 ` [Qemu-devel] [PULL 0/5] vnc patch queue Peter Maydell
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=1432110853-11399-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=jtomko@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).