summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2010-10-07 06:37:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-07 05:43:35 -0700
commitc7b518ab85f6fbcbdbae64c8fa092e998a14d1e9 (patch)
tree4f55db97bf6e843c96637264c8d97219a5b0aa38 /xlators/mgmt/glusterd/src/glusterd-handler.c
parentf62484f42230db9d240c9b0eaadac48d845053b1 (diff)
mgmt/Glusterd: Volume set enhancements
- performance.flush-behind, transport.keepalive added - volume info to display the options reconfigured Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1159 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 448dd6534..57239c626 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -254,6 +254,7 @@ out:
return ret;
}
+
int
glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
dict_t *volumes, int count)
@@ -264,6 +265,11 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo = NULL;
char *buf = NULL;
int i = 1;
+ data_pair_t *pairs = NULL;
+ char reconfig_key[256] = {0, };
+ dict_t *dict = NULL;
+ data_t *value = NULL;
+
GF_ASSERT (volinfo);
GF_ASSERT (volumes);
@@ -309,6 +315,37 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
goto out;
i++;
}
+
+ dict = volinfo->dict;
+ if (!dict) {
+ ret = -1;
+ goto out;
+ }
+
+ pairs = dict->members_list;
+ if (!pairs) {
+ ret = -1;
+ goto out;
+ }
+
+ while (pairs) {
+ if (1 == glusterd_check_option_exists (pairs->key, NULL)) {
+ value = pairs->value;
+ if (!value) {
+ ret = -1;
+ goto out;
+ }
+ snprintf (reconfig_key, 256, "volume%d.option.%s", count,
+ pairs->key);
+ gf_log ("", GF_LOG_DEBUG,
+ "Setting dict with key=%s, value=%s",
+ reconfig_key, pairs->value->data);
+ ret = dict_set_str (volumes, gf_strdup (reconfig_key),
+ value->data);
+ }
+ pairs = pairs->next;
+ }
+
out:
return ret;
}