aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-03-06 11:53:27 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-03-06 11:53:27 +0000
commit1464ad45cd6cdeb0b5c1a54d3d3791396e47e52f (patch)
tree12e5fa81ad1f1cf455c598a5351c1b4248b38b84 /ui/vnc.c
parent3c0f12df65da872d5fbccae469f2cb21ed1c03b7 (diff)
parent48eb62a74fc2d6b0ae9e5f414304a85cfbf33066 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-03-04' into staging
QAPI patches for 2016-03-04 # gpg: Signature made Sat 05 Mar 2016 09:47:19 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-qapi-2016-03-04: qapi: Drop useless 'data' member of unions chardev: Drop useless ChardevDummy type qapi: Avoid use of 'data' member of QAPI unions ui: Shorten references into InputEvent util: Shorten references into SocketAddress chardev: Shorten references into ChardevBackend qapi: Update docs to match recent generator changes qapi-visit: Expose visit_type_FOO_members() qapi: Rename 'fields' to 'members' in generated C code qapi: Rename 'fields' to 'members' in generator qapi-dealloc: Reduce use outside of generated code qmp-shell: fix pretty printing of JSON responses Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/vnc.c')
-rw-r--r--ui/vnc.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index ce4c669ec9..6cd63141c4 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3530,12 +3530,13 @@ void vnc_display_open(const char *id, Error **errp)
}
} else {
unsigned long long baseport;
+ InetSocketAddress *inet;
saddr->type = SOCKET_ADDRESS_KIND_INET;
- saddr->u.inet = g_new0(InetSocketAddress, 1);
+ inet = saddr->u.inet = g_new0(InetSocketAddress, 1);
if (vnc[0] == '[' && vnc[hlen - 1] == ']') {
- saddr->u.inet->host = g_strndup(vnc + 1, hlen - 2);
+ inet->host = g_strndup(vnc + 1, hlen - 2);
} else {
- saddr->u.inet->host = g_strndup(vnc, hlen);
+ inet->host = g_strndup(vnc, hlen);
}
if (parse_uint_full(h + 1, &baseport, 10) < 0) {
error_setg(errp, "can't convert to a number: %s", h + 1);
@@ -3546,32 +3547,32 @@ void vnc_display_open(const char *id, Error **errp)
error_setg(errp, "port %s out of range", h + 1);
goto fail;
}
- saddr->u.inet->port = g_strdup_printf(
+ inet->port = g_strdup_printf(
"%d", (int)baseport + 5900);
if (to) {
- saddr->u.inet->has_to = true;
- saddr->u.inet->to = to + 5900;
+ inet->has_to = true;
+ inet->to = to + 5900;
}
- saddr->u.inet->ipv4 = ipv4;
- saddr->u.inet->has_ipv4 = has_ipv4;
- saddr->u.inet->ipv6 = ipv6;
- saddr->u.inet->has_ipv6 = has_ipv6;
+ inet->ipv4 = ipv4;
+ inet->has_ipv4 = has_ipv4;
+ inet->ipv6 = ipv6;
+ inet->has_ipv6 = has_ipv6;
if (vs->ws_enabled) {
wsaddr->type = SOCKET_ADDRESS_KIND_INET;
- wsaddr->u.inet = g_new0(InetSocketAddress, 1);
- wsaddr->u.inet->host = g_strdup(saddr->u.inet->host);
- wsaddr->u.inet->port = g_strdup(websocket);
+ inet = wsaddr->u.inet = g_new0(InetSocketAddress, 1);
+ inet->host = g_strdup(saddr->u.inet->host);
+ inet->port = g_strdup(websocket);
if (to) {
- wsaddr->u.inet->has_to = true;
- wsaddr->u.inet->to = to;
+ inet->has_to = true;
+ inet->to = to;
}
- wsaddr->u.inet->ipv4 = ipv4;
- wsaddr->u.inet->has_ipv4 = has_ipv4;
- wsaddr->u.inet->ipv6 = ipv6;
- wsaddr->u.inet->has_ipv6 = has_ipv6;
+ inet->ipv4 = ipv4;
+ inet->has_ipv4 = has_ipv4;
+ inet->ipv6 = ipv6;
+ inet->has_ipv6 = has_ipv6;
}
}
} else {