diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-09 15:49:08 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-09 15:49:14 -0400 |
commit | 76d20ea0f1b26ebd5da2f5fb2fdf3250cde887bb (patch) | |
tree | bcb0e4a8f29bdcfa0f5785a09608bff57a82107c /ui | |
parent | 7ed57b66221b5a3e23b3519824637b297dc92090 (diff) | |
parent | dcd3b25d656d346205dc0f2254723fccf0264e45 (diff) |
Merge remote-tracking branch 'armbru/tags/pull-qapi-2017-05-04-v3' into staging
QAPI patches for 2017-05-04
# gpg: Signature made Tue 09 May 2017 03:16:12 AM EDT
# gpg: using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* armbru/tags/pull-qapi-2017-05-04-v3: (28 commits)
qmp-shell: improve help
qmp-shell: don't show version greeting if unavailable
qmp-shell: Cope with query-commands error
qmp-shell: add -N option to skip negotiate
qmp-shell: add persistent command history
qobject-input-visitor: Catch misuse of end_struct vs. end_list
qapi: Document intended use of @name within alternate visits
qobject-input-visitor: Document full_name_nth()
qmp: Improve QMP dispatch error messages
sockets: Delete unused helper socket_address_crumple()
sockets: Limit SocketAddressLegacy to external interfaces
sockets: Rename SocketAddressFlat to SocketAddress
sockets: Rename SocketAddress to SocketAddressLegacy
qapi: New QAPI_CLONE_MEMBERS()
sockets: Prepare inet_parse() for flattened SocketAddress
sockets: Prepare vsock_parse() for flattened SocketAddress
test-qga: Actually test 0xff sync bytes
fdc-test: Avoid deprecated 'change' command
QemuOpts: Simplify qemu_opts_to_qdict()
block: Simplify bdrv_append_temp_snapshot() logic
...
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/vnc-auth-sasl.c | 5 | ||||
-rw-r--r-- | ui/vnc.c | 68 |
2 files changed, 35 insertions, 38 deletions
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c index 5ae29c14cf..3ade4a4918 100644 --- a/ui/vnc-auth-sasl.c +++ b/ui/vnc-auth-sasl.c @@ -510,12 +510,11 @@ vnc_socket_ip_addr_string(QIOChannelSocket *ioc, return NULL; } - if (addr->type != SOCKET_ADDRESS_KIND_INET) { + if (addr->type != SOCKET_ADDRESS_TYPE_INET) { error_setg(errp, "Not an inet socket type"); return NULL; } - ret = g_strdup_printf("%s;%s", addr->u.inet.data->host, - addr->u.inet.data->port); + ret = g_strdup_printf("%s;%s", addr->u.inet.host, addr->u.inet.port); qapi_free_SocketAddress(addr); return ret; } @@ -113,26 +113,26 @@ static void vnc_init_basic_info(SocketAddress *addr, Error **errp) { switch (addr->type) { - case SOCKET_ADDRESS_KIND_INET: - info->host = g_strdup(addr->u.inet.data->host); - info->service = g_strdup(addr->u.inet.data->port); - if (addr->u.inet.data->ipv6) { + case SOCKET_ADDRESS_TYPE_INET: + info->host = g_strdup(addr->u.inet.host); + info->service = g_strdup(addr->u.inet.port); + if (addr->u.inet.ipv6) { info->family = NETWORK_ADDRESS_FAMILY_IPV6; } else { info->family = NETWORK_ADDRESS_FAMILY_IPV4; } break; - case SOCKET_ADDRESS_KIND_UNIX: + case SOCKET_ADDRESS_TYPE_UNIX: info->host = g_strdup(""); - info->service = g_strdup(addr->u.q_unix.data->path); + info->service = g_strdup(addr->u.q_unix.path); info->family = NETWORK_ADDRESS_FAMILY_UNIX; break; - case SOCKET_ADDRESS_KIND_VSOCK: - case SOCKET_ADDRESS_KIND_FD: + case SOCKET_ADDRESS_TYPE_VSOCK: + case SOCKET_ADDRESS_TYPE_FD: error_setg(errp, "Unsupported socket address type %s", - SocketAddressKind_lookup[addr->type]); + SocketAddressType_lookup[addr->type]); break; default: abort(); @@ -398,26 +398,26 @@ VncInfo *qmp_query_vnc(Error **errp) } switch (addr->type) { - case SOCKET_ADDRESS_KIND_INET: - info->host = g_strdup(addr->u.inet.data->host); - info->service = g_strdup(addr->u.inet.data->port); - if (addr->u.inet.data->ipv6) { + case SOCKET_ADDRESS_TYPE_INET: + info->host = g_strdup(addr->u.inet.host); + info->service = g_strdup(addr->u.inet.port); + if (addr->u.inet.ipv6) { info->family = NETWORK_ADDRESS_FAMILY_IPV6; } else { info->family = NETWORK_ADDRESS_FAMILY_IPV4; } break; - case SOCKET_ADDRESS_KIND_UNIX: + case SOCKET_ADDRESS_TYPE_UNIX: info->host = g_strdup(""); - info->service = g_strdup(addr->u.q_unix.data->path); + info->service = g_strdup(addr->u.q_unix.path); info->family = NETWORK_ADDRESS_FAMILY_UNIX; break; - case SOCKET_ADDRESS_KIND_VSOCK: - case SOCKET_ADDRESS_KIND_FD: + case SOCKET_ADDRESS_TYPE_VSOCK: + case SOCKET_ADDRESS_TYPE_FD: error_setg(errp, "Unsupported socket address type %s", - SocketAddressKind_lookup[addr->type]); + SocketAddressType_lookup[addr->type]); goto out_error; default: abort(); @@ -3161,13 +3161,13 @@ static void vnc_display_print_local_addr(VncDisplay *vd) return; } - if (addr->type != SOCKET_ADDRESS_KIND_INET) { + if (addr->type != SOCKET_ADDRESS_TYPE_INET) { qapi_free_SocketAddress(addr); return; } error_printf_unless_qmp("VNC server running on %s:%s\n", - addr->u.inet.data->host, - addr->u.inet.data->port); + addr->u.inet.host, + addr->u.inet.port); qapi_free_SocketAddress(addr); } @@ -3423,9 +3423,8 @@ static int vnc_display_get_address(const char *addrstr, addr = g_new0(SocketAddress, 1); if (strncmp(addrstr, "unix:", 5) == 0) { - addr->type = SOCKET_ADDRESS_KIND_UNIX; - addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); - addr->u.q_unix.data->path = g_strdup(addrstr + 5); + addr->type = SOCKET_ADDRESS_TYPE_UNIX; + addr->u.q_unix.path = g_strdup(addrstr + 5); if (websocket) { error_setg(errp, "UNIX sockets not supported with websock"); @@ -3461,8 +3460,8 @@ static int vnc_display_get_address(const char *addrstr, } } - addr->type = SOCKET_ADDRESS_KIND_INET; - inet = addr->u.inet.data = g_new0(InetSocketAddress, 1); + addr->type = SOCKET_ADDRESS_TYPE_INET; + inet = &addr->u.inet; if (addrstr[0] == '[' && addrstr[hostlen - 1] == ']') { inet->host = g_strndup(addrstr + 1, hostlen - 2); } else { @@ -3601,13 +3600,12 @@ static int vnc_display_get_addresses(QemuOpts *opts, * address for websocket too */ if (*retnsaddr == 1 && - (*retsaddr)[0]->type == SOCKET_ADDRESS_KIND_INET && - wsaddr->type == SOCKET_ADDRESS_KIND_INET && - g_str_equal(wsaddr->u.inet.data->host, "") && - !g_str_equal((*retsaddr)[0]->u.inet.data->host, "")) { - g_free(wsaddr->u.inet.data->host); - wsaddr->u.inet.data->host = - g_strdup((*retsaddr)[0]->u.inet.data->host); + (*retsaddr)[0]->type == SOCKET_ADDRESS_TYPE_INET && + wsaddr->type == SOCKET_ADDRESS_TYPE_INET && + g_str_equal(wsaddr->u.inet.host, "") && + !g_str_equal((*retsaddr)[0]->u.inet.host, "")) { + g_free(wsaddr->u.inet.host); + wsaddr->u.inet.host = g_strdup((*retsaddr)[0]->u.inet.host); } *retwsaddr = g_renew(SocketAddress *, *retwsaddr, *retnwsaddr + 1); @@ -3648,8 +3646,8 @@ static int vnc_display_connect(VncDisplay *vd, error_setg(errp, "Expected a single address in reverse mode"); return -1; } - /* TODO SOCKET_ADDRESS_KIND_FD when fd has AF_UNIX */ - vd->is_unix = saddr[0]->type == SOCKET_ADDRESS_KIND_UNIX; + /* TODO SOCKET_ADDRESS_TYPE_FD when fd has AF_UNIX */ + vd->is_unix = saddr[0]->type == SOCKET_ADDRESS_TYPE_UNIX; sioc = qio_channel_socket_new(); qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-reverse"); if (qio_channel_socket_connect_sync(sioc, saddr[0], errp) < 0) { |