summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2015-12-16 18:04:55 +0530
committerDan Lambright <dlambrig@redhat.com>2015-12-22 16:29:14 -0800
commit86fa1507a15eb9e1e4a8e1e83785b5a46eee9aa4 (patch)
tree4be4ffc1feec659676171c08ea8b79e94526f9f0 /cli
parenta7de0cd095f799e3128f74fcccc57ac4d6fd0b6d (diff)
cli/xml: display correct xml output of tier volume
This patch is backport of: http://review.gluster.org/#/c/12982/ Currently When hot tier type is distributed-replicate and cold tier type is disperse volume then #gluster volume info --xml command is not giving its correct output. In case of HOT tier case its displaying wrong volume type. With this fix it will show correct xml output for tier volume irrespective of all the type of the volume's. >> Change-Id: If1de8d52d1e0ef3d0523163abed37b2b571715e8 >> BUG: 1293309 >> Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> >> Reviewed-on: http://review.gluster.org/12982 >> Tested-by: NetBSD Build System <jenkins@build.gluster.org> >> Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> >> Tested-by: Gluster Build System <jenkins@build.gluster.com> >> Reviewed-by: Kotresh HR <khiremat@redhat.com> >> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Change-Id: If1de8d52d1e0ef3d0523163abed37b2b571715e8 BUG: 1293309 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> (cherry picked from commit b0e126d0edf10946701c2fd4f0f1cf8c7b07eda1) Reviewed-on: http://review.gluster.org/13042 Reviewed-by: hari gowtham <hari.gowtham005@gmail.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-xml-output.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 0801d61eeea..7140f803071 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -2799,7 +2799,7 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
value[HOT_REPLICA_COUNT] : 1);
if ((value[HOT_TYPE] != GF_CLUSTER_TYPE_TIER) &&
(value[HOT_TYPE] > 0) &&
- (value[hot_dist_count] < value[HOT_BRICK_COUNT]))
+ (hot_dist_count < value[HOT_BRICK_COUNT]))
tier_vol_type = value[HOT_TYPE] +
GF_CLUSTER_TYPE_MAX - 1;
@@ -2812,6 +2812,18 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
(local->writer, (xmlChar *)"hotBrickType",
"%s", cli_vol_type_str[tier_vol_type]);
+ ret = xmlTextWriterWriteFormatElement (local->writer,
+ (xmlChar *)"hotreplicaCount",
+ "%d",
+ value[HOT_REPLICA_COUNT]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement (local->writer,
+ (xmlChar *)"hotbrickCount",
+ "%d",
+ value[HOT_BRICK_COUNT]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
if (value[HOT_TYPE] == GF_CLUSTER_TYPE_NONE ||
value[HOT_TYPE] ==
GF_CLUSTER_TYPE_TIER) {
@@ -2820,26 +2832,14 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
(xmlChar *)"numberOfBricks",
"%d", value[HOT_BRICK_COUNT]);
XML_RET_CHECK_AND_GOTO (ret, out);
- } else if (value[HOT_TYPE] ==
- GF_CLUSTER_TYPE_DISPERSE) {
- ret = xmlTextWriterWriteFormatElement
- (local->writer,
- (xmlChar *)"numberOfBricks",
- "%d x (%d + %d) = %d",
- (value[HOT_BRICK_COUNT] /
- value[hot_dist_count]),
- hot_disperse_count -
- hot_redundancy_count,
- hot_redundancy_count,
- value[HOT_BRICK_COUNT]);
} else {
ret = xmlTextWriterWriteFormatElement
(local->writer,
(xmlChar *)"numberOfBricks",
"%d x %d = %d",
(value[HOT_BRICK_COUNT] /
- value[hot_dist_count]),
- value[hot_dist_count],
+ hot_dist_count),
+ hot_dist_count,
value[HOT_BRICK_COUNT]);
}
@@ -2904,6 +2904,22 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
(local->writer, (xmlChar *)"coldBrickType",
"%s", cli_vol_type_str[tier_vol_type]);
+ ret = xmlTextWriterWriteFormatElement (local->writer,
+ (xmlChar *)"coldreplicaCount",
+ "%d", value[COLD_REPLICA_COUNT]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement (local->writer,
+ (xmlChar *)"coldbrickCount",
+ "%d",
+ value[COLD_BRICK_COUNT]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
+ ret = xmlTextWriterWriteFormatElement (local->writer,
+ (xmlChar *)"colddisperseCount",
+ "%d", value[COLD_DISPERSE_COUNT]);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
if (value[COLD_TYPE] == GF_CLUSTER_TYPE_NONE ||
value[COLD_TYPE] ==
GF_CLUSTER_TYPE_TIER) {
@@ -2912,6 +2928,7 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
(xmlChar *)"numberOfBricks",
"%d", value[COLD_BRICK_COUNT]);
XML_RET_CHECK_AND_GOTO (ret, out);
+
} else if (value[COLD_TYPE] ==
GF_CLUSTER_TYPE_DISPERSE) {
ret = xmlTextWriterWriteFormatElement