summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-xml-output.c
diff options
context:
space:
mode:
authorBala.FA <barumuga@redhat.com>2013-10-29 17:17:12 +0530
committerAnand Avati <avati@redhat.com>2013-11-26 11:53:13 -0800
commit25dadcf6725b834bf735224ba165330b8872af4f (patch)
tree6e51a7e843ef87b5fdc5c2f1fb09b15aac6a7092 /cli/src/cli-xml-output.c
parente412da34e927737efae711740191c59749214e9a (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: I0e58e323534a19d485c9523466bce215bd466160 Signed-off-by: Bala.FA <barumuga@redhat.com> Reviewed-on: http://review.gluster.org/6267 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli/src/cli-xml-output.c')
-rw-r--r--cli/src/cli-xml-output.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 21ca1ae7fb7..fcb061fcce3 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -237,6 +237,7 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
int ret = -1;
char *hostname = NULL;
char *path = NULL;
+ char *uuid = NULL;
int port = 0;
int status = 0;
int pid = 0;
@@ -264,6 +265,15 @@ cli_xml_output_vol_status_common (xmlTextWriterPtr writer, dict_t *dict,
XML_RET_CHECK_AND_GOTO (ret, out);
memset (key, 0, sizeof (key));
+ snprintf (key, sizeof (key), "brick%d.peerid", brick_index);
+ ret = dict_get_str (dict, key, &uuid);
+ if (ret)
+ goto out;
+ ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"peerid",
+ "%s", uuid);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "brick%d.status", brick_index);
ret = dict_get_int32 (dict, key, &status);
if (ret)