diff options
author | Bala.FA <barumuga@redhat.com> | 2013-10-29 17:17:12 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-14 23:31:32 -0800 |
commit | 432cecfbff496bfa9e71e8cbbed789458656c553 (patch) | |
tree | 10cc9c84b2321e933c965cd65721ed480e0e067a /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 884a668a9c3e12e17d64ebd5ccd9fbf3d203fd1e (diff) |
cli: add peerid to volume status xml output
This patch adds <peerid> tag to bricks and nfs/shd like services to
volume status xml output.
BUG: 955548
Change-Id: I9aaa9266e4d56f632235eaeef565e92d757c0694
Signed-off-by: Bala.FA <barumuga@redhat.com>
Reviewed-on: http://review.gluster.org/6162
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index b7b71adb2..52fa9ecd6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -3249,6 +3249,29 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx) count = brick_index_max + other_count + 1; + /* add 'brick%d.peerid' into op_ctx with value of 'brick%d.path'. + nfs/sshd like services have this additional uuid */ + { + char key[1024]; + char *uuid_str = NULL; + char *uuid = NULL; + int i; + + for (i = brick_index_max + 1; i < count; i++) { + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "brick%d.path", i); + ret = dict_get_str (op_ctx, key, &uuid_str); + if (!ret) { + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), + "brick%d.peerid", i); + uuid = gf_strdup (uuid_str); + ret = dict_set_dynstr (op_ctx, key, + uuid); + } + } + } + ret = glusterd_op_volume_dict_uuid_to_hostname (op_ctx, "brick%d.path", 0, count); |