summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorMeghana Madhusudhan <mmadhusu@redhat.com>2015-02-02 16:23:22 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-18 04:33:13 -0700
commit38ccaaf9d1a93c4fc6d733ee3bd5c73e5457bdab (patch)
tree8856e8a6a869d6a0f1444c74e6bd05b08d950940 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent8a9c909702f4f6836bd1d0c791a7b1ae79d4ba15 (diff)
CLI : GLobal option for NFS-Ganesha
A new global CLI option has been introduced for NFS-Ganesha. gluster features.ganesha enable/disable. This option is persistent and shall be inherited by new volumes created after this option is set. gluster features.ganesha enable It carries out the following functions: 1. Disables gluster-nfs across the cluster 2. Starts NFS-Ganesha server on a subset of nodes and exports '/'. 3. Creates the HA cluster for NFS-Ganesha. 4. Writes the option into the global config file. gluster features.ganesha disable 1. Stops NFS-Ganesha server. 2. Tears down the HA cluster for NFS-Ganesha With this change the older volume set options with keys "nfs-ganesha.host" and "nfs-ganesha.enable" will no longer be supported. This commit has only has the CLI related changes. Another patch will be submitted to support this feature entirely. Change-Id: Ie4b66a16c23b33b795738654b9a68f8e2c34efe3 BUG: 1188184 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/9538 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 2f121e49e9e..035b4528e10 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1881,7 +1881,6 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict)
*/
goto out;
}
-
ret = -1;
dup_opt = dict_new ();
if (!dup_opt)
@@ -1938,7 +1937,7 @@ out:
}
static int
-glusterd_op_set_volume (dict_t *dict)
+glusterd_op_set_volume (dict_t *dict, char **errstr)
{
int ret = 0;
glusterd_volinfo_t *volinfo = NULL;
@@ -2055,6 +2054,9 @@ glusterd_op_set_volume (dict_t *dict)
}
}
+ ret = glusterd_check_ganesha_cmd (key, value, errstr, dict);
+ if (ret == -1)
+ goto out;
if (!is_key_glusterd_hooks_friendly (key)) {
ret = glusterd_check_option_exists (key, &key_fixed);
GF_ASSERT (ret);
@@ -3471,6 +3473,12 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx)
break;
}
+ case GD_OP_GANESHA:
+ {
+ dict_copy (dict, req_dict);
+ break;
+ }
+
default:
break;
}
@@ -4848,6 +4856,10 @@ glusterd_op_stage_validate (glusterd_op_t op, dict_t *dict, char **op_errstr,
ret = glusterd_op_stage_set_volume (dict, op_errstr);
break;
+ case GD_OP_GANESHA:
+ ret = glusterd_op_stage_set_ganesha (dict, op_errstr);
+ break;
+
case GD_OP_RESET_VOLUME:
ret = glusterd_op_stage_reset_volume (dict, op_errstr);
break;
@@ -4959,7 +4971,10 @@ glusterd_op_commit_perform (glusterd_op_t op, dict_t *dict, char **op_errstr,
break;
case GD_OP_SET_VOLUME:
- ret = glusterd_op_set_volume (dict);
+ ret = glusterd_op_set_volume (dict, op_errstr);
+ break;
+ case GD_OP_GANESHA:
+ ret = glusterd_op_set_ganesha (dict, op_errstr);
break;
case GD_OP_RESET_VOLUME: