summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-04-17 10:46:06 +0000
committerAnand Avati <avati@gluster.com>2011-04-17 21:40:59 -0700
commit4b813b3d14476a5cf6a3a54c32c2939a31fe9ba9 (patch)
treeff5d4181a8aa6d736cadf004f24ea791621e4de4 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent666e43aca607c90d95379caa13b42a4ed976e8a7 (diff)
mgmt/glusterd: unify the geo-replication status rpc messages.
the intelligence of determining the type of status command is now at glusterd, rather then explicitly setting it while parsing at cli. Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2536 (gsync service introspection) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2536
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c49
1 files changed, 10 insertions, 39 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index ea63a98b898..2f5dbdc1505 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -2426,8 +2426,6 @@ out:
static int
glusterd_verify_gsync_status_opts (dict_t *dict, char **op_errstr)
{
- int status_type = 0;
- char *master = NULL;
char *slave = NULL;
char *volname = NULL;
char errmsg[PATH_MAX] = {0, };
@@ -2435,23 +2433,9 @@ glusterd_verify_gsync_status_opts (dict_t *dict, char **op_errstr)
glusterd_volinfo_t *volinfo = NULL;
int ret = 0;
-
- ret = dict_get_int32 (dict, "status-type", &status_type);
- if (ret)
- goto out;
-
- if (status_type == GF_GSYNC_OPTION_TYPE_STATUS_ALL)
- goto out;
-
- ret = dict_get_str (dict, "master", &master);
- if (ret < 0)
- goto out;
-
- volname = volname_from_master (master);
- if (volname == NULL) {
- gf_log ("", GF_LOG_WARNING, "volname couldn't be found");
- *op_errstr = gf_strdup ("volname not found");
- ret = -1;
+ ret = dict_get_str (dict, "master", &volname);
+ if (ret < 0) {
+ ret = 0;
goto out;
}
@@ -2466,23 +2450,13 @@ glusterd_verify_gsync_status_opts (dict_t *dict, char **op_errstr)
goto out;
}
-
- if (status_type == GF_GSYNC_OPTION_TYPE_STATUS_MASTER)
- goto out;
-
- if (status_type != GF_GSYNC_OPTION_TYPE_STATUS_MST_SLV)
- goto out;
-
ret = dict_get_str (dict, "slave", &slave);
- if (ret < 0)
+ if (ret < 0) {
+ ret = 0;
goto out;
-
- ret = glusterd_op_verify_gsync_running (volinfo, master,
- slave, op_errstr);
+ }
out:
- if (volname)
- GF_FREE (volname);
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -4665,7 +4639,6 @@ out:
static int
glusterd_get_gsync_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
{
- int status_type = 0;
char *master = NULL;
char *slave = NULL;
char *volname = NULL;
@@ -4675,11 +4648,8 @@ glusterd_get_gsync_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
int ret = 0;
- ret = dict_get_int32 (dict, "status-type", &status_type);
- if (ret)
- goto out;
-
- if (status_type == GF_GSYNC_OPTION_TYPE_STATUS_ALL) {
+ ret = dict_get_str (dict, "master", &volname);
+ if (ret < 0){
ret = glusterd_get_gsync_status_all (rsp_dict);
goto out;
}
@@ -4708,7 +4678,8 @@ glusterd_get_gsync_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
}
- if (status_type == GF_GSYNC_OPTION_TYPE_STATUS_MASTER) {
+ ret = dict_get_str (dict, "slave", &slave);
+ if (ret < 0) {
ret = glusterd_get_gsync_status_mst (volinfo, rsp_dict);
goto out;
}