diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-18 17:18:41 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-03-18 17:18:41 +0000 |
commit | 4829e0378dfb91d55af9dfd741bd09e8f2c4f91a (patch) | |
tree | 75532c6629f6b4994267a1b42ea635c7b1443702 /util | |
parent | 879c26fb9fd950eefcac64cc854b22edc05e317a (diff) | |
parent | 3666a97f78704b941c360dc917acb14c8774eca7 (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-03-18' into staging
QAPI patches for 2016-03-18
# gpg: Signature made Fri 18 Mar 2016 09:54:57 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-18:
qapi: Use anonymous bases in QMP flat unions
qapi: Allow anonymous base for flat union
qapi: Make BlockdevOptions doc example closer to reality
qapi: Don't special-case simple union wrappers
qapi: Drop unused c_null()
qapi: Inline gen_visit_members() into lone caller
qapi-commands: Inline single-use helpers of gen_marshal()
qapi-commands: Utilize implicit struct visits
qapi-event: Utilize implicit struct visits
qapi-event: Drop qmp_output_get_qobject() null check
qapi: Emit implicit structs in generated C
qapi: Adjust names of implicit types
qapi: Make c_type() more OO-like
qapi: Fix command with named empty argument type
qapi: Assert in places where variants are not handled
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/qemu-sockets.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index fd37ac209b..540649a7af 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -901,8 +901,8 @@ SocketAddress *socket_parse(const char *str, Error **errp) goto fail; } else { addr->type = SOCKET_ADDRESS_KIND_UNIX; - addr->u.q_unix = g_new(UnixSocketAddress, 1); - addr->u.q_unix->path = g_strdup(str + 5); + addr->u.q_unix.data = g_new(UnixSocketAddress, 1); + addr->u.q_unix.data->path = g_strdup(str + 5); } } else if (strstart(str, "fd:", NULL)) { if (str[3] == '\0') { @@ -910,13 +910,13 @@ SocketAddress *socket_parse(const char *str, Error **errp) goto fail; } else { addr->type = SOCKET_ADDRESS_KIND_FD; - addr->u.fd = g_new(String, 1); - addr->u.fd->str = g_strdup(str + 3); + addr->u.fd.data = g_new(String, 1); + addr->u.fd.data->str = g_strdup(str + 3); } } else { addr->type = SOCKET_ADDRESS_KIND_INET; - addr->u.inet = inet_parse(str, errp); - if (addr->u.inet == NULL) { + addr->u.inet.data = inet_parse(str, errp); + if (addr->u.inet.data == NULL) { goto fail; } } @@ -934,15 +934,15 @@ int socket_connect(SocketAddress *addr, Error **errp, switch (addr->type) { case SOCKET_ADDRESS_KIND_INET: - fd = inet_connect_saddr(addr->u.inet, errp, callback, opaque); + fd = inet_connect_saddr(addr->u.inet.data, errp, callback, opaque); break; case SOCKET_ADDRESS_KIND_UNIX: - fd = unix_connect_saddr(addr->u.q_unix, errp, callback, opaque); + fd = unix_connect_saddr(addr->u.q_unix.data, errp, callback, opaque); break; case SOCKET_ADDRESS_KIND_FD: - fd = monitor_get_fd(cur_mon, addr->u.fd->str, errp); + fd = monitor_get_fd(cur_mon, addr->u.fd.data->str, errp); if (fd >= 0 && callback) { qemu_set_nonblock(fd); callback(fd, NULL, opaque); @@ -961,15 +961,15 @@ int socket_listen(SocketAddress *addr, Error **errp) switch (addr->type) { case SOCKET_ADDRESS_KIND_INET: - fd = inet_listen_saddr(addr->u.inet, 0, false, errp); + fd = inet_listen_saddr(addr->u.inet.data, 0, false, errp); break; case SOCKET_ADDRESS_KIND_UNIX: - fd = unix_listen_saddr(addr->u.q_unix, false, errp); + fd = unix_listen_saddr(addr->u.q_unix.data, false, errp); break; case SOCKET_ADDRESS_KIND_FD: - fd = monitor_get_fd(cur_mon, addr->u.fd->str, errp); + fd = monitor_get_fd(cur_mon, addr->u.fd.data->str, errp); break; default: @@ -984,7 +984,8 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp) switch (remote->type) { case SOCKET_ADDRESS_KIND_INET: - fd = inet_dgram_saddr(remote->u.inet, local ? local->u.inet : NULL, errp); + fd = inet_dgram_saddr(remote->u.inet.data, + local ? local->u.inet.data : NULL, errp); break; default: @@ -1018,7 +1019,7 @@ socket_sockaddr_to_address_inet(struct sockaddr_storage *sa, addr = g_new0(SocketAddress, 1); addr->type = SOCKET_ADDRESS_KIND_INET; - inet = addr->u.inet = g_new0(InetSocketAddress, 1); + inet = addr->u.inet.data = g_new0(InetSocketAddress, 1); inet->host = g_strdup(host); inet->port = g_strdup(serv); if (sa->ss_family == AF_INET) { @@ -1042,10 +1043,10 @@ socket_sockaddr_to_address_unix(struct sockaddr_storage *sa, addr = g_new0(SocketAddress, 1); addr->type = SOCKET_ADDRESS_KIND_UNIX; - addr->u.q_unix = g_new0(UnixSocketAddress, 1); + addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); if (su->sun_path[0]) { - addr->u.q_unix->path = g_strndup(su->sun_path, - sizeof(su->sun_path)); + addr->u.q_unix.data->path = g_strndup(su->sun_path, + sizeof(su->sun_path)); } return addr; |