Skip to content

Commit

Permalink
glusterfsd: To support volfile-server-transport type "unix"
Browse files Browse the repository at this point in the history
glusterfsd fails if the glusterd is bind to specific-IP address.
This patch helps glusterfsd to get the volfile using Unix domain socket.
glusterfs -s <unix socket path> --volfile-server-transport unix
          --volfile-id <volume-name> <mount-point>
The patch checks if the volfile-server-transport is of type "unix",
If It is then uses rpc_transport_unix_options_build to get the volfile.

Change-Id: I81b881e7ac5a3a4f2ac83c789c385cf547f0d53e
BUG: 1279484
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/12556
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
  • Loading branch information
Mohamed Ashiq authored and Atin Mukherjee committed Nov 20, 2015
1 parent 097e131 commit 7fbc385
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions glusterfsd/src/glusterfsd-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,18 +2101,22 @@ glusterfs_mgmt_init (glusterfs_ctx_t *ctx)
char *host = NULL;

cmd_args = &ctx->cmd_args;
GF_VALIDATE_OR_GOTO (THIS->name, cmd_args->volfile_server, out);

if (ctx->mgmt)
return 0;

if (cmd_args->volfile_server_port)
port = cmd_args->volfile_server_port;

host = "localhost";
if (cmd_args->volfile_server)
host = cmd_args->volfile_server;
host = cmd_args->volfile_server;

ret = rpc_transport_inet_options_build (&options, host, port);
if (cmd_args->volfile_server_transport &&
!strcmp (cmd_args->volfile_server_transport, "unix")) {
ret = rpc_transport_unix_options_build (&options, host, 0);
} else {
ret = rpc_transport_inet_options_build (&options, host, port);
}
if (ret)
goto out;

Expand Down
4 changes: 2 additions & 2 deletions glusterfsd/src/glusterfsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ static error_t parse_opts (int32_t key, char *arg, struct argp_state *_state);
static struct argp_option gf_options[] = {
{0, 0, 0, 0, "Basic options:"},
{"volfile-server", ARGP_VOLFILE_SERVER_KEY, "SERVER", 0,
"Server to get the volume file from. This option overrides "
"--volfile option"},
"Server to get the volume file from. Unix domain socket path when "
"transport type 'unix'. This option overrides --volfile option"},
{"volfile", ARGP_VOLUME_FILE_KEY, "VOLFILE", 0,
"File to use as VOLUME_FILE"},
{"spec-file", ARGP_VOLUME_FILE_KEY, "VOLFILE", OPTION_HIDDEN,
Expand Down

0 comments on commit 7fbc385

Please sign in to comment.