summaryrefslogtreecommitdiffstats
path: root/cli
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 /cli
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 'cli')
-rw-r--r--cli/src/cli3_1-cops.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c
index 81e7ed663f6..8f170b98f9f 100644
--- a/cli/src/cli3_1-cops.c
+++ b/cli/src/cli3_1-cops.c
@@ -319,6 +319,33 @@ out:
return ret;
}
+void
+cli_out_options ( char *substr, char *optstr, char *valstr)
+{
+ char *ptr1 = NULL;
+ char *ptr2 = NULL;
+
+ ptr1 = substr;
+ ptr2 = optstr;
+
+ while (ptr1)
+ {
+ if (*ptr1 != *ptr2)
+ break;
+ ptr1++;
+ ptr2++;
+ if (!ptr1)
+ return;
+ if (!ptr2)
+ return;
+ }
+
+ if (*ptr2 == '\0')
+ return;
+ cli_out ("%s: %s",ptr2 , valstr);
+}
+
+
int
gf_cli3_1_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
int count, void *myframe)
@@ -338,6 +365,11 @@ gf_cli3_1_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
int32_t j = 1;
cli_local_t *local = NULL;
int32_t transport = 0;
+ data_pair_t *pairs = NULL;
+ char *ptr = NULL;
+ data_t *value = NULL;
+
+
if (-1 == req->rpc_status) {
goto out;
@@ -474,6 +506,28 @@ gf_cli3_1_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
cli_out ("Brick%d: %s", j, brick);
j++;
}
+ pairs = dict->members_list;
+ if (!pairs) {
+ ret = -1;
+ goto out;
+ }
+
+ snprintf (key, 256, "volume%d.option.",i);
+ cli_out ("Options Reconfigured:");
+ while (pairs) {
+ ptr = strstr (pairs->key, "option.");
+ if (ptr) {
+ value = pairs->value;
+ if (!value) {
+ ret = -1;
+ goto out;
+ }
+ cli_out_options (key, pairs->key,
+ value->data);
+ }
+ pairs = pairs->next;
+ }
+
i++;
}