[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 20/27] gluster: Drop assumptions on SocketTransport n
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 20/27] gluster: Drop assumptions on SocketTransport names |
Date: |
Tue, 7 Mar 2017 16:40:44 +0100 |
From: Markus Armbruster <address@hidden>
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>
Signed-off-by: Kevin Wolf <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);
}
--
1.8.3.1
- [Qemu-block] [PULL 09/27] block: Handle permission errors in change_parent_backing_link(), (continued)
- [Qemu-block] [PULL 09/27] block: Handle permission errors in change_parent_backing_link(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 10/27] block: Fix error handling in bdrv_replace_in_backing_chain(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 13/27] sheepdog: Fix error handling sd_create(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 14/27] sheepdog: Mark sd_snapshot_delete() lossage FIXME, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 12/27] sheepdog: Fix error handling in sd_snapshot_delete(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 15/27] sheepdog: Fix snapshot ID parsing in _open(), _create, _goto(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 16/27] sheepdog: Don't truncate long VDI name in _open(), _create(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 19/27] sheepdog: Implement bdrv_parse_filename(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 17/27] sheepdog: Report errors in pseudo-filename more usefully, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 18/27] sheepdog: Use SocketAddress and socket_connect(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 20/27] gluster: Drop assumptions on SocketTransport names,
Kevin Wolf <=
- [Qemu-block] [PULL 21/27] gluster: Don't duplicate qapi-util.c's qapi_enum_parse(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 22/27] gluster: Plug memory leaks in qemu_gluster_parse_json(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 25/27] sheepdog: Support blockdev-add, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 24/27] qapi-schema: Rename SocketAddressFlat's variant tcp to inet, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 23/27] qapi-schema: Rename GlusterServer to SocketAddressFlat, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 27/27] commit: Don't use error_abort in commit_start, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 26/27] block: Don't use error_abort in blk_new_open, Kevin Wolf, 2017/03/07
- Re: [Qemu-block] [Qemu-devel] [PULL 00/27] Block layer fixes for 2.9.0-rc0, Peter Maydell, 2017/03/08