summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.c
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2017-07-31 10:51:21 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-08-04 06:26:05 +0000
commit2e7daeffef05c6100cbcc39f1be62935711db3eb (patch)
tree54486620f27572319552623a14eff460c4f5e398 /libglusterfs/src/common-utils.c
parent590ae48c65a60c93c2e5407e3f663cef3daacc55 (diff)
glusterd: Add geo-replication session details to get-state output
This commit adds support to the get-state CLI to capture details on geo-replication session as obtained in `gluster volume geo-replication status detail` in its output. Fixes: #291 Change-Id: I2fbcba70bfdaf439522637234805545194777ed4 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17941 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r--libglusterfs/src/common-utils.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index e855f04a443..5897aca0b38 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -53,6 +53,7 @@
#include "xxhash.h"
#include <ifaddrs.h>
#include "libglusterfs-messages.h"
+#include "protocol-common.h"
#ifndef AI_ADDRCONFIG
#define AI_ADDRCONFIG 0
@@ -4930,3 +4931,38 @@ glusterfs_compute_sha256 (const unsigned char *content, size_t size,
return 0;
}
+
+char*
+get_struct_variable (int mem_num, gf_gsync_status_t *sts_val)
+{
+ switch (mem_num) {
+ case 0: return (sts_val->node);
+ case 1: return (sts_val->master);
+ case 2: return (sts_val->brick);
+ case 3: return (sts_val->slave_user);
+ case 4: return (sts_val->slave);
+ case 5: return (sts_val->slave_node);
+ case 6: return (sts_val->worker_status);
+ case 7: return (sts_val->crawl_status);
+ case 8: return (sts_val->last_synced);
+ case 9: return (sts_val->entry);
+ case 10: return (sts_val->data);
+ case 11: return (sts_val->meta);
+ case 12: return (sts_val->failures);
+ case 13: return (sts_val->checkpoint_time);
+ case 14: return (sts_val->checkpoint_completed);
+ case 15: return (sts_val->checkpoint_completion_time);
+ case 16: return (sts_val->brick_host_uuid);
+ case 17: return (sts_val->last_synced_utc);
+ case 18: return (sts_val->checkpoint_time_utc);
+ case 19: return (sts_val->checkpoint_completion_time_utc);
+ case 20: return (sts_val->slavekey);
+ case 21: return (sts_val->session_slave);
+ default:
+ goto out;
+ }
+
+out:
+ return NULL;
+}
+