summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-sm.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-10-02 04:12:51 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-02 07:04:15 -0700
commit1b7a997a7b368aa459dcd57ec23532fe4cdd6e0c (patch)
tree2bb68dbd7c436d1b5eb42fa63b8f213220384e4c /xlators/mgmt/glusterd/src/glusterd-sm.c
parentef44323b4ba58fa8c1eb89105851983f828dd91b (diff)
mgmt/glusterd: print peer state names instead of state numbers
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1779 (print peer state names instead of state numbers) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1779
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index f540658c3..fbe843034 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -46,6 +46,25 @@
static struct list_head gd_friend_sm_queue;
+static char *glusterd_friend_sm_state_names[] = {
+ "Establishing Connection",
+ "Probe Sent to Peer",
+ "Probe Received from Peer",
+ "Peer in Cluster",
+ "Accepted peer request",
+ "Sent and Received peer request",
+ "Peer Rejected",
+ "Peer detach in progress",
+ "Invalid State"
+};
+
+char*
+glusterd_friend_sm_state_name_get (glusterd_friend_sm_state_t state)
+{
+ if (state < 0 || state >= GD_FRIEND_STATE_MAX)
+ return glusterd_friend_sm_state_names[GD_FRIEND_STATE_MAX];
+ return glusterd_friend_sm_state_names[state];
+}
void
glusterd_destroy_probe_ctx (glusterd_probe_ctx_t *ctx)
{