summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-mgmt.c
diff options
context:
space:
mode:
authorMohamed Ashiq <mliyazud@redhat.com>2015-11-10 13:18:41 +0530
committerNiels de Vos <ndevos@redhat.com>2015-12-02 01:19:54 -0800
commit41d84bb6256bdd17df09cce3d51a89d44c117bab (patch)
tree3d2c003b67b186d4979c65700813283ca33b8eab /api/src/glfs-mgmt.c
parent43c1a95b44f937b3e9d072bab87bb1e8817c1249 (diff)
libgfapi: To support set_volfile-server-transport type "unix"
This patch helps libgfapi to get the volfile using Unix domain socket. run the attachment file in the bug to test. The patch checks if the glfs_set_volfile_server transport is of type "unix", If It is then uses rpc_transport_unix_options_build to get the volfile. Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> >Change-Id: Ifd5d1e7c0d8cc9a906c3c3355b8977141e892a2f >BUG: 1279739 >Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> >Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> >Reviewed-on: http://review.gluster.org/12563 >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Niels de Vos <ndevos@redhat.com> >Reviewed-by: Poornima G <pgurusid@redhat.com> >Reviewed-by: Raghavendra Talur <rtalur@redhat.com> >Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Change-Id: I0b3f2023e6698366d8c20d6574f5de7b8a641f30 BUG: 1283038 Reviewed-on: http://review.gluster.org/12645 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src/glfs-mgmt.c')
-rw-r--r--api/src/glfs-mgmt.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 903b10293c6..ba1f4599488 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -860,11 +860,21 @@ glfs_mgmt_init (struct glfs *fs)
if (cmd_args->volfile_server_port)
port = cmd_args->volfile_server_port;
- host = "localhost";
- if (cmd_args->volfile_server)
+ if (cmd_args->volfile_server) {
host = cmd_args->volfile_server;
+ } else if (cmd_args->volfile_server_transport &&
+ !strcmp (cmd_args->volfile_server_transport, "unix")) {
+ host = DEFAULT_GLUSTERD_SOCKFILE;
+ } else {
+ host = "localhost";
+ }
+
+ if (!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);
+ }
- ret = rpc_transport_inet_options_build (&options, host, port);
if (ret)
goto out;