diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-04-26 09:36:40 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-05-09 09:14:40 +0200 |
commit | 62cf396b5d397948c5ac4d04d09596ca14f6c173 (patch) | |
tree | baa345a9664bb014988d3e9e1cf12e0d21a46d8e /block/nbd.c | |
parent | dfd100f242370886bb6732f70f1f7cbd8eb9fedc (diff) |
sockets: Rename SocketAddressFlat to SocketAddress
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1493192202-3184-6-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'block/nbd.c')
-rw-r--r-- | block/nbd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/block/nbd.c b/block/nbd.c index 7f11a939fc..bbe0f99d6c 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -47,7 +47,7 @@ typedef struct BDRVNBDState { NBDClientSession client; /* For nbd_refresh_filename() */ - SocketAddressFlat *saddr; + SocketAddress *saddr; char *export, *tlscredsid; } BDRVNBDState; @@ -258,10 +258,10 @@ static bool nbd_process_legacy_socket_options(QDict *output_options, return true; } -static SocketAddressFlat *nbd_config(BDRVNBDState *s, QDict *options, - Error **errp) +static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, + Error **errp) { - SocketAddressFlat *saddr = NULL; + SocketAddress *saddr = NULL; QDict *addr = NULL; QObject *crumpled_addr = NULL; Visitor *iv = NULL; @@ -287,7 +287,7 @@ static SocketAddressFlat *nbd_config(BDRVNBDState *s, QDict *options, * visitor expects the former. */ iv = qobject_input_visitor_new(crumpled_addr); - visit_type_SocketAddressFlat(iv, NULL, &saddr, &local_err); + visit_type_SocketAddress(iv, NULL, &saddr, &local_err); if (local_err) { error_propagate(errp, local_err); goto done; @@ -306,7 +306,7 @@ NBDClientSession *nbd_get_client_session(BlockDriverState *bs) return &s->client; } -static QIOChannelSocket *nbd_establish_connection(SocketAddressFlat *saddr_flat, +static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr_flat, Error **errp) { SocketAddressLegacy *saddr = socket_address_crumple(saddr_flat); @@ -412,7 +412,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, goto error; } - /* Translate @host, @port, and @path to a SocketAddressFlat */ + /* Translate @host, @port, and @path to a SocketAddress */ if (!nbd_process_legacy_socket_options(options, opts, errp)) { goto error; } @@ -433,7 +433,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, } /* TODO SOCKET_ADDRESS_KIND_FD where fd has AF_INET or AF_INET6 */ - if (s->saddr->type != SOCKET_ADDRESS_FLAT_TYPE_INET) { + if (s->saddr->type != SOCKET_ADDRESS_TYPE_INET) { error_setg(errp, "TLS only supported over IP sockets"); goto error; } @@ -460,7 +460,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, object_unref(OBJECT(tlscreds)); } if (ret < 0) { - qapi_free_SocketAddressFlat(s->saddr); + qapi_free_SocketAddress(s->saddr); g_free(s->export); g_free(s->tlscredsid); } @@ -486,7 +486,7 @@ static void nbd_close(BlockDriverState *bs) nbd_client_close(bs); - qapi_free_SocketAddressFlat(s->saddr); + qapi_free_SocketAddress(s->saddr); g_free(s->export); g_free(s->tlscredsid); } @@ -517,13 +517,13 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) Visitor *ov; const char *host = NULL, *port = NULL, *path = NULL; - if (s->saddr->type == SOCKET_ADDRESS_FLAT_TYPE_INET) { + if (s->saddr->type == SOCKET_ADDRESS_TYPE_INET) { const InetSocketAddress *inet = &s->saddr->u.inet; if (!inet->has_ipv4 && !inet->has_ipv6 && !inet->has_to) { host = inet->host; port = inet->port; } - } else if (s->saddr->type == SOCKET_ADDRESS_FLAT_TYPE_UNIX) { + } else if (s->saddr->type == SOCKET_ADDRESS_TYPE_UNIX) { path = s->saddr->u.q_unix.path; } /* else can't represent as pseudo-filename */ @@ -544,7 +544,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) } ov = qobject_output_visitor_new(&saddr_qdict); - visit_type_SocketAddressFlat(ov, NULL, &s->saddr, &error_abort); + visit_type_SocketAddress(ov, NULL, &s->saddr, &error_abort); visit_complete(ov, &saddr_qdict); visit_free(ov); qdict_put_obj(opts, "server", saddr_qdict); |