summaryrefslogtreecommitdiffstats
path: root/cli/src/cli.c
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2018-04-16 11:55:02 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-04-18 08:27:40 +0000
commit9a1ae47c8d60836ae0628a04a153f28c1085c0e8 (patch)
treebc1ad9129605eae792234024153990ec391a8784 /cli/src/cli.c
parent7b0781a45bba826a790aa4d5a125693ac2be28ab (diff)
Add CLI option to print XLATORDIR
glusterfs gets the path to xlator dir from a compile time flag named XLATORDIR which gets passed through a -D flag to GCC. This path is used to find and load xlator shared objects. The XLATORDIR path isn't easily accessible to glusterd2. Glusterd2 currently uses the following command (hack) to get value of XLATORDIR: $ strings -d `which glusterfsd` | awk '/glusterfs/*/xlator$/' This change introduces "print-xlatordir" CLI option to expose XLATORDIR. The option is intentionally not documented. Updates: bz#1193929 Change-Id: Ic7247457600f11cd8d68eb3d0ad2526fdfda0b02 Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'cli/src/cli.c')
-rw-r--r--cli/src/cli.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index b58f211d3dd..7903b57edb6 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -338,6 +338,12 @@ cli_opt_parse (char *opt, struct cli_state *state)
exit (0);
}
+ /* XLATORDIR passed through a -D flag to GCC */
+ if (strcmp (opt, "print-xlatordir") == 0) {
+ cli_out ("%s", XLATORDIR);
+ exit (0);
+ }
+
if (strcmp (opt, "xml") == 0) {
#if (HAVE_LIB_XML)
state->mode |= GLUSTER_MODE_XML;