summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2018-02-09 09:27:03 +0530
committerAmar Tumballi <amarts@redhat.com>2018-02-16 16:16:25 +0000
commit664b946496368f625b5a15646b5aa791078055ef (patch)
tree0a574ce8ed3fee1b6d4fa6811def116ac8d170f6 /glusterfsd/src/glusterfsd.c
parentb313d97faa766443a7f8128b6e19f3d2f1b267dd (diff)
Fetch backup volfile servers from glusterd2
Clients will request for a list of volfile servers from glusterd2 by setting a (optional) flag in GETSPEC RPC call. glusterd2 will check for the presence of this flag and accordingly return a list of glusterd2 servers in GETSPEC RPC reply. Currently, this list of servers returned only contains servers which have bricks belonging to the volume. See: https://github.com/gluster/glusterd2/issues/382 https://github.com/gluster/glusterfs/issues/351 Updates #351 Change-Id: I0eee3d0bf25a87627e562380ef73063926a16b81 Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 3bfd0f12384..dfaf9c09c6d 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -718,7 +718,6 @@ gf_remember_backup_volfile_server (char *arg)
glusterfs_ctx_t *ctx = NULL;
cmd_args_t *cmd_args = NULL;
int ret = -1;
- server_cmdline_t *server = NULL;
ctx = glusterfsd_ctx;
if (!ctx)
@@ -728,39 +727,15 @@ gf_remember_backup_volfile_server (char *arg)
if(!cmd_args)
goto out;
- server = GF_CALLOC (1, sizeof (server_cmdline_t),
- gfd_mt_server_cmdline_t);
- if (!server)
- goto out;
-
- INIT_LIST_HEAD(&server->list);
-
- server->volfile_server = gf_strdup(arg);
-
- if (!cmd_args->volfile_server) {
- cmd_args->volfile_server = server->volfile_server;
- cmd_args->curr_server = server;
- }
-
- if (!server->volfile_server) {
- gf_msg ("glusterfsd", GF_LOG_WARNING, 0, glusterfsd_msg_10,
- "xlator option %s is invalid", arg);
- goto out;
+ ret = gf_set_volfile_server_common(cmd_args, arg,
+ GF_DEFAULT_VOLFILE_TRANSPORT,
+ GF_DEFAULT_BASE_PORT);
+ if (ret) {
+ gf_log ("glusterfs", GF_LOG_ERROR,
+ "failed to set volfile server: %s", strerror (errno));
}
-
- list_add_tail (&server->list, &cmd_args->volfile_servers);
-
- ret = 0;
out:
- if (ret == -1) {
- if (server) {
- GF_FREE (server->volfile_server);
- GF_FREE (server);
- }
- }
-
return ret;
-
}
static int