summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2012-01-13 18:21:39 +0530
committerAnand Avati <avati@gluster.com>2012-01-14 02:35:09 -0800
commit0e1679aee746040cdd509c5cd4004a4641c4c203 (patch)
tree5d6dcb68314dd09ea95ecc8bf42f07321b8f676e /xlators/mgmt/glusterd
parentfaf9099bb50d4d2c1a9fe8d3232d541b3f68bc58 (diff)
cli,glusterd: Display volume UUID in the output of 'volume info'
Cleaned up some leaks along the way. Change-Id: Ibc76c539eee935c0630f9580d0d914814b1a6fe1 BUG: 781445 Signed-off-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/2643 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 7817e1dd653..4766aa19a6c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -287,6 +287,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
data_t *value = NULL;
int opt_count = 0;
glusterd_conf_t *priv = NULL;
+ char *volume_id_str = NULL;
GF_ASSERT (volinfo);
@@ -336,6 +337,15 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
if (ret)
goto out;
+ volume_id_str = gf_strdup (uuid_utoa (volinfo->volume_id));
+ if (!volume_id_str)
+ goto out;
+
+ snprintf (key, sizeof (key), "volume%d.volume_id", count);
+ ret = dict_set_dynstr (volumes, key, volume_id_str);
+ 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);