提交 fc29458d 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

gluster: Drop assumptions on SocketTransport names

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: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NNiels de Vos <ndevos@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 831acdc9
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册