diff options
author | Mohammed Junaid Ahmed <junaid@gluster.com> | 2011-02-10 05:29:34 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-10 22:18:06 -0800 |
commit | 2e81c881f036d90323fd07d7df07d881723d7a28 (patch) | |
tree | 261c45c9faf90f70a8140994adcc02b9cd881220 /cli/src/cli-cmd-volume.c | |
parent | 08ca1d3c7801d22f1de452f098b0a5df251ca5e7 (diff) |
gsync: cli support for gsyncd.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1570 (geosync related changes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index fd2a7afe0..7ecfde2e0 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -879,6 +879,47 @@ out: return ret; } +int +cli_cmd_volume_gsync_set_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + int ret = 0; + int parse_err = 0; + dict_t *options = NULL; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + + proc = &cli_rpc_prog->proctable [GF1_CLI_GSYNC_SET]; + if (proc == NULL) { + ret = -1; + goto out; + } + + frame = create_frame (THIS, THIS->ctx->pool); + if (frame == NULL) { + ret = -1; + goto out; + } + + ret = cli_cmd_gsync_set_parse (words, wordcount, &options); + if (ret) { + cli_usage_out (word->pattern); + parse_err = 1; + goto out; + } + + if (proc->fn) + ret = proc->fn (frame, THIS, options); + +out: + if (options) + dict_unref (options); + + if (ret && parse_err == 0) + cli_out ("Gsync command failed"); + + return ret; +} struct cli_cmd volume_cmds[] = { { "volume info [all|<VOLNAME>]", @@ -953,6 +994,10 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_reset_cbk, "reset all the reconfigured options"}, + {"volume gsync <start|stop|configure> <MASTER> <SLAVE> [options]", + cli_cmd_volume_gsync_set_cbk, + "Geo-sync operations"}, + { NULL, NULL, NULL } }; |