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: Markus Armbruster <armbru@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
831acdc95e
commit
fc29458dee
@ -412,8 +412,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
|
|||||||
|
|
||||||
for (server = gconf->server; server; server = server->next) {
|
for (server = gconf->server; server; server = server->next) {
|
||||||
if (server->value->type == GLUSTER_TRANSPORT_UNIX) {
|
if (server->value->type == GLUSTER_TRANSPORT_UNIX) {
|
||||||
ret = glfs_set_volfile_server(glfs,
|
ret = glfs_set_volfile_server(glfs, "unix",
|
||||||
GlusterTransport_lookup[server->value->type],
|
|
||||||
server->value->u.q_unix.path, 0);
|
server->value->u.q_unix.path, 0);
|
||||||
} else {
|
} else {
|
||||||
if (parse_uint_full(server->value->u.tcp.port, &port, 10) < 0 ||
|
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;
|
errno = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
ret = glfs_set_volfile_server(glfs,
|
ret = glfs_set_volfile_server(glfs, "tcp",
|
||||||
GlusterTransport_lookup[server->value->type],
|
|
||||||
server->value->u.tcp.host,
|
server->value->u.tcp.host,
|
||||||
(int)port);
|
(int)port);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user