From e1b1fff65f21ffc7a134e41b1b37977ee4cc75d4 Mon Sep 17 00:00:00 2001
From: Atin Mukherjee <amukherj@redhat.com>
Date: Sun, 20 Nov 2016 18:18:45 +0530
Subject: [PATCH 188/206] glusterd: dump volinfo->dict in gluster get-state
>Reviewed-on: http://review.gluster.org/15889
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>
>Reviewed-by: Rohan Kanade <rkanade@redhat.com>
Change-Id: I7e60629fb8003c620847fa63441f6b098db59721
BUG: 1397257
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/90858
---
xlators/mgmt/glusterd/src/glusterd-handler.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 417c300..b9270d8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -4949,7 +4949,7 @@ glusterd_handle_get_vol_opt (rpcsvc_request_t *req)
}
static int
-glusterd_print_global_options (dict_t *opts, char *key, data_t *val, void *data)
+glusterd_print_dict_options (dict_t *opts, char *key, data_t *val, void *data)
{
FILE *fp = NULL;
@@ -5129,7 +5129,7 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
fprintf (fp, "\n[Global options]\n");
if (priv->opts)
- dict_foreach (priv->opts, glusterd_print_global_options, fp);
+ dict_foreach (priv->opts, glusterd_print_dict_options, fp);
rcu_read_lock ();
fprintf (fp, "\n[Peers]\n");
@@ -5352,6 +5352,10 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
volinfo->rep_brick.dst_brick->hostname,
volinfo->rep_brick.dst_brick->path);
}
+ fprintf (fp, "[Volume%d.options]\n", count);
+ if (volinfo->dict)
+ dict_foreach (volinfo->dict,
+ glusterd_print_dict_options, fp);
fprintf (fp, "\n");
}
--
2.9.3