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 /block/sheepdog.c | |
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 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index fe8fd923d5..a18315a1ca 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -536,14 +536,12 @@ static SocketAddress *sd_socket_address(const char *path, SocketAddress *addr = g_new0(SocketAddress, 1); if (path) { - addr->type = SOCKET_ADDRESS_KIND_UNIX; - addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); - addr->u.q_unix.data->path = g_strdup(path); + addr->type = SOCKET_ADDRESS_TYPE_UNIX; + addr->u.q_unix.path = g_strdup(path); } else { - addr->type = SOCKET_ADDRESS_KIND_INET; - addr->u.inet.data = g_new0(InetSocketAddress, 1); - addr->u.inet.data->host = g_strdup(host ?: SD_DEFAULT_ADDR); - addr->u.inet.data->port = g_strdup(port ?: stringify(SD_DEFAULT_PORT)); + addr->type = SOCKET_ADDRESS_TYPE_INET; + addr->u.inet.host = g_strdup(host ?: SD_DEFAULT_ADDR); + addr->u.inet.port = g_strdup(port ?: stringify(SD_DEFAULT_PORT)); } return addr; @@ -554,7 +552,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp) QDict *server = NULL; QObject *crumpled_server = NULL; Visitor *iv = NULL; - SocketAddressFlat *saddr_flat = NULL; SocketAddress *saddr = NULL; Error *local_err = NULL; @@ -574,16 +571,13 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp) * visitor expects the former. */ iv = qobject_input_visitor_new(crumpled_server); - visit_type_SocketAddressFlat(iv, NULL, &saddr_flat, &local_err); + visit_type_SocketAddress(iv, NULL, &saddr, &local_err); if (local_err) { error_propagate(errp, local_err); goto done; } - saddr = socket_address_crumple(saddr_flat); - done: - qapi_free_SocketAddressFlat(saddr_flat); visit_free(iv); qobject_decref(crumpled_server); QDECREF(server); @@ -597,7 +591,7 @@ static int connect_to_sdog(BDRVSheepdogState *s, Error **errp) fd = socket_connect(s->addr, NULL, NULL, errp); - if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) { + if (s->addr->type == SOCKET_ADDRESS_TYPE_INET && fd >= 0) { int ret = socket_set_nodelay(fd); if (ret < 0) { error_report("%s", strerror(errno)); |