From 2e81c881f036d90323fd07d7df07d881723d7a28 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Thu, 10 Feb 2011 05:29:34 +0000 Subject: gsync: cli support for gsyncd. Signed-off-by: Junaid Signed-off-by: Anand V. Avati BUG: 1570 (geosync related changes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570 --- cli/src/cli-cmd-volume.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index fd2a7afe..7ecfde2e 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|]", @@ -953,6 +994,10 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_reset_cbk, "reset all the reconfigured options"}, + {"volume gsync [options]", + cli_cmd_volume_gsync_set_cbk, + "Geo-sync operations"}, + { NULL, NULL, NULL } }; -- cgit