[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 10/15] gluster: Drop assumptions on SocketTranspo
From: |
Markus Armbruster |
Subject: |
[Qemu-block] [PATCH v2 10/15] gluster: Drop assumptions on SocketTransport names |
Date: |
Mon, 6 Mar 2017 20:00:44 +0100 |
qemu_gluster_glfs_init() passes the names of QAPI enumeration type
SocketTransport to glfs_set_volfile_server(). Works, because they
were chosen to match. But the coupling is artificial. Use the
appropriate literal strings instead.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Niels de Vos <address@hidden>
---
block/gluster.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/gluster.c b/block/gluster.c
index 56b4abe..7236d59 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -412,8 +412,7 @@ static struct glfs
*qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
for (server = gconf->server; server; server = server->next) {
if (server->value->type == GLUSTER_TRANSPORT_UNIX) {
- ret = glfs_set_volfile_server(glfs,
-
GlusterTransport_lookup[server->value->type],
+ ret = glfs_set_volfile_server(glfs, "unix",
server->value->u.q_unix.path, 0);
} else {
if (parse_uint_full(server->value->u.tcp.port, &port, 10) < 0 ||
@@ -423,8 +422,7 @@ static struct glfs
*qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
errno = EINVAL;
goto out;
}
- ret = glfs_set_volfile_server(glfs,
-
GlusterTransport_lookup[server->value->type],
+ ret = glfs_set_volfile_server(glfs, "tcp",
server->value->u.tcp.host,
(int)port);
}
--
2.7.4
- [Qemu-block] [PATCH v2 00/15] block: A bunch of fixes for Sheepdog and Gluster, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 04/15] sheepdog: Mark sd_snapshot_delete() lossage FIXME, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 02/15] sheepdog: Fix error handling in sd_snapshot_delete(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 03/15] sheepdog: Fix error handling sd_create(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 01/15] sheepdog: Defuse time bomb in sd_open() error handling, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 08/15] sheepdog: Use SocketAddress and socket_connect(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 10/15] gluster: Drop assumptions on SocketTransport names,
Markus Armbruster <=
- [Qemu-block] [PATCH v2 06/15] sheepdog: Don't truncate long VDI name in _open(), _create(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 05/15] sheepdog: Fix snapshot ID parsing in _open(), _create, _goto(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 12/15] gluster: Plug memory leaks in qemu_gluster_parse_json(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 07/15] sheepdog: Report errors in pseudo-filename more usefully, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 13/15] qapi-schema: Rename GlusterServer to SocketAddressFlat, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 09/15] sheepdog: Implement bdrv_parse_filename(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 11/15] gluster: Don't duplicate qapi-util.c's qapi_enum_parse(), Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 15/15] sheepdog: Support blockdev-add, Markus Armbruster, 2017/03/06
- [Qemu-block] [PATCH v2 14/15] qapi-schema: Rename SocketAddressFlat's variant tcp to inet, Markus Armbruster, 2017/03/06
- Re: [Qemu-block] [PATCH v2 00/15] block: A bunch of fixes for Sheepdog and Gluster, Kevin Wolf, 2017/03/07