summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2016-07-27 14:23:23 +0530
committerNiels de Vos <ndevos@redhat.com>2016-07-27 08:45:23 -0700
commit6e78a0dda9343d75674a12b7e1a1e8e59e17c78c (patch)
treead40cdb5e5867626332c1e06782d24a6ea8b8390 /api/src
parentae4f59f929be36b40c9f8e20804b6bc4564cc7a3 (diff)
gfapi: deprecate rdma support for management connections
RDMA transport was never supported for management connection before, but glfs_set_volfile_server() allowed rdma transport type due to lack of defense code and the glusterfs_mgmt_init() code silently fall back to tcp with out any warnings, this gave a chance for assumtions that mgmt connection also supports rdma along with tcp and unix. This patch deprecates the rdma support by warning at its usage. Change-Id: I0ad99d9851e05ff84ba4b6a3534a984bcc7e2ed7 BUG: 1360647 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/15026 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index bd70e7f610f..e46c875bb79 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -443,7 +443,24 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport,
}
if (transport) {
- server->transport = gf_strdup (transport);
+ /* volfile fetch support over tcp|unix only */
+ if (!strcmp(transport, "tcp") || !strcmp(transport, "unix")) {
+ server->transport = gf_strdup (transport);
+ } else if (!strcmp(transport, "rdma")) {
+ server->transport = gf_strdup ("tcp");
+ gf_msg ("glfs", GF_LOG_WARNING, EINVAL,
+ API_MSG_INVALID_ENTRY,
+ "transport RDMA is deprecated, "
+ "falling back to tcp");
+ } else {
+ gf_msg ("glfs", GF_LOG_TRACE, EINVAL,
+ API_MSG_INVALID_ENTRY,
+ "transport %s is not supported, "
+ "possible values tcp|unix",
+ transport);
+ ret = -1;
+ goto out;
+ }
} else {
server->transport = gf_strdup (GF_DEFAULT_VOLFILE_TRANSPORT);
}
@@ -453,10 +470,14 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport,
goto out;
}
- if (port) {
- server->port = port;
+ if (strcmp(server->transport, "unix")) {
+ if (port) {
+ server->port = port;
+ } else {
+ server->port = GF_DEFAULT_BASE_PORT;
+ }
} else {
- server->port = GF_DEFAULT_BASE_PORT;
+ server->port = 0;
}
if (!cmd_args->volfile_server) {