diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-07-27 14:49:07 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-27 19:39:40 -0700 |
commit | 9460675a921d504a31088b0e0f42143cc7f2a56f (patch) | |
tree | 30e00eeb0f42da671d778df73a014483ae931ea7 /xlators/mgmt/glusterd/src | |
parent | 26cc6b015bb29f942194d1ca2a3dd21d5483d829 (diff) |
DVM: Changes in CLI output
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1220 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1220
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 27 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 8fe0b31a6..80ca1f325 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -298,8 +298,11 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, dict_t *volumes, int count) { - int ret = -1; - char key[256] = {0, }; + int ret = -1; + char key[256] = {0, }; + glusterd_brickinfo_t *brickinfo = NULL; + char *buf = NULL; + int i = 1; GF_ASSERT (volinfo); GF_ASSERT (volumes); @@ -324,6 +327,17 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, if (ret) goto out; + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { + char brick[1024] = {0,}; + snprintf (key, 256, "volume%d.brick%d", count, i); + snprintf (brick, 1024, "%s:%s", brickinfo->hostname, + brickinfo->path); + buf = gf_strdup (brick); + ret = dict_set_dynstr (volumes, key, buf); + if (ret) + goto out; + i++; + } out: return ret; } @@ -1753,16 +1767,17 @@ glusterd_get_volumes (rpcsvc_request_t *req, dict_t *dict, int32_t flags) ret = 0; out: - if (ret) { - if (volumes) - dict_destroy (volumes); - } rsp.op_ret = ret; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, gf_xdr_serialize_cli_peer_list_rsp); + if (volumes) + dict_destroy (volumes); + + if (rsp.volumes.volumes_val) + GF_FREE (rsp.volumes.volumes_val); return ret; } diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 1a954cce2..8016f93db 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2025,9 +2025,9 @@ glusterd_op_clear_ctx (glusterd_op_t op) ctx = opinfo.op_ctx[op]; - if (ctx) - GF_FREE (ctx); + opinfo.op_ctx[op] = NULL; + //Cleanup to be done here return 0; } |