diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-04-26 09:36:39 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-05-09 09:14:40 +0200 |
commit | dfd100f242370886bb6732f70f1f7cbd8eb9fedc (patch) | |
tree | 3ad4f17ad74b5b420f556ccea55b391a39d5a2c5 /block | |
parent | 4626a19c86c30d96cedbac2bd44ef8103303cb37 (diff) | |
download | qemu-dfd100f242370886bb6732f70f1f7cbd8eb9fedc.zip qemu-dfd100f242370886bb6732f70f1f7cbd8eb9fedc.tar.gz qemu-dfd100f242370886bb6732f70f1f7cbd8eb9fedc.tar.bz2 |
sockets: Rename SocketAddress to SocketAddressLegacy
The next commit will rename SocketAddressFlat to SocketAddress, and
the commit after that will replace most uses of SocketAddressLegacy by
SocketAddress, replacing most of this commit's renames right back.
Note that checkpatch emits a few "line over 80 characters" warnings.
The long lines are all temporary; the SocketAddressLegacy replacement
will shorten them again.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1493192202-3184-5-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 4 | ||||
-rw-r--r-- | block/sheepdog.c | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/block/nbd.c b/block/nbd.c index 37969eb..7f11a93 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -309,7 +309,7 @@ NBDClientSession *nbd_get_client_session(BlockDriverState *bs) static QIOChannelSocket *nbd_establish_connection(SocketAddressFlat *saddr_flat, Error **errp) { - SocketAddress *saddr = socket_address_crumple(saddr_flat); + SocketAddressLegacy *saddr = socket_address_crumple(saddr_flat); QIOChannelSocket *sioc; Error *local_err = NULL; @@ -319,7 +319,7 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddressFlat *saddr_flat, qio_channel_socket_connect_sync(sioc, saddr, &local_err); - qapi_free_SocketAddress(saddr); + qapi_free_SocketAddressLegacy(saddr); if (local_err) { object_unref(OBJECT(sioc)); error_propagate(errp, local_err); diff --git a/block/sheepdog.c b/block/sheepdog.c index fe8fd92..055d10b 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -378,7 +378,7 @@ struct BDRVSheepdogState { uint32_t cache_flags; bool discard_supported; - SocketAddress *addr; + SocketAddressLegacy *addr; int fd; CoMutex lock; @@ -530,17 +530,17 @@ static void sd_aio_setup(SheepdogAIOCB *acb, BDRVSheepdogState *s, QLIST_INSERT_HEAD(&s->inflight_aiocb_head, acb, aiocb_siblings); } -static SocketAddress *sd_socket_address(const char *path, +static SocketAddressLegacy *sd_socket_address(const char *path, const char *host, const char *port) { - SocketAddress *addr = g_new0(SocketAddress, 1); + SocketAddressLegacy *addr = g_new0(SocketAddressLegacy, 1); if (path) { - addr->type = SOCKET_ADDRESS_KIND_UNIX; + addr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX; addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); addr->u.q_unix.data->path = g_strdup(path); } else { - addr->type = SOCKET_ADDRESS_KIND_INET; + addr->type = SOCKET_ADDRESS_LEGACY_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)); @@ -549,13 +549,13 @@ static SocketAddress *sd_socket_address(const char *path, return addr; } -static SocketAddress *sd_server_config(QDict *options, Error **errp) +static SocketAddressLegacy *sd_server_config(QDict *options, Error **errp) { QDict *server = NULL; QObject *crumpled_server = NULL; Visitor *iv = NULL; SocketAddressFlat *saddr_flat = NULL; - SocketAddress *saddr = NULL; + SocketAddressLegacy *saddr = NULL; Error *local_err = NULL; qdict_extract_subqdict(options, &server, "server."); @@ -597,7 +597,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_LEGACY_KIND_INET && fd >= 0) { int ret = socket_set_nodelay(fd); if (ret < 0) { error_report("%s", strerror(errno)); @@ -2149,7 +2149,7 @@ static void sd_close(BlockDriverState *bs) aio_set_fd_handler(bdrv_get_aio_context(bs), s->fd, false, NULL, NULL, NULL, NULL); closesocket(s->fd); - qapi_free_SocketAddress(s->addr); + qapi_free_SocketAddressLegacy(s->addr); } static int64_t sd_getlength(BlockDriverState *bs) |