diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-10-03 02:41:29 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-03 03:05:03 -0700 |
commit | 609a89ceace25a0a81d0a9cafde3a4d1afd1b916 (patch) | |
tree | 0205b67be6e1e2f33e9a0c9c1ca4ea0737ebff05 /cli/src/cli-cmd-volume.c | |
parent | 53b8c7470f9e40c60c5eebd1fbad5c6d274f7ee5 (diff) |
mgmt/Glusterd: new command volume reset <volname>, volume set enhancementsv3.1.0qa39
- Write the reconfigured options in 'info' file to make it persistant
- Implementation of volume set <volname> history
- Implementation of volume reset <volname>
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1159 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
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 8d846d8732c..3c433c523e0 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -72,6 +72,12 @@ cli_cmd_volume_info_usage () } void +cli_cmd_volume_reset_usage () +{ + cli_out ("Usage: volume reset <VOLNAME> "); +} + +void cli_cmd_volume_set_usage () { cli_out ("Usage: volume set <VOLNAME> <KEY> <VALUE>"); @@ -481,6 +487,41 @@ out: return 0; } +int +cli_cmd_volume_reset_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + + int ret = -1; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + dict_t *options = NULL; + + proc = &cli_rpc_prog->proctable[GF1_CLI_RESET_VOLUME]; + + frame = create_frame (THIS, THIS->ctx->pool); + if (!frame) + goto out; + + ret = cli_cmd_volume_reset_parse (words, wordcount, &options); + + if (ret) { + cli_cmd_volume_reset_usage (); + goto out; + } + + if (proc->fn) { + ret = proc->fn (frame, THIS, options); + } + +out: + if (options) + dict_unref (options); + + return ret; + +} + int cli_cmd_volume_set_cbk (struct cli_state *state, struct cli_cmd_word *word, @@ -886,6 +927,10 @@ struct cli_cmd volume_cmds[] = { { "volume sync <HOSTNAME> [all|<VOLNAME>]", cli_cmd_sync_volume_cbk, "sync the volume information from a peer"}, + + { "volume reset <VOLNAME> ", + cli_cmd_volume_reset_cbk, + "reset all the reconfigured options"}, { NULL, NULL, NULL } }; |