diff options
author | Pranith K <pranithk@gluster.com> | 2011-03-10 02:20:39 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-10 08:09:58 -0800 |
commit | a0aafa365dd355864d24232bd6d7f399ef38f9ef (patch) | |
tree | 5911492054085849f13f7a8a58983ee599c242db /cli/src/cli-cmd-volume.c | |
parent | 496a04f3b2d46893635f93e5a33032969a826cd2 (diff) |
cli: gluster profile CLI
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1965 (need a cmd to get io-stat details)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1965
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 8414a50b69c..f53db3d80b6 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -570,6 +570,49 @@ out: } +int +cli_cmd_volume_profile_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + int sent = 0; + int parse_error = 0; + + int ret = -1; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + dict_t *options = NULL; + + ret = cli_cmd_volume_profile_parse (words, wordcount, &options); + + if (ret) { + cli_usage_out (word->pattern); + parse_error = 1; + goto out; + } + + proc = &cli_rpc_prog->proctable[GLUSTER_CLI_PROFILE_VOLUME]; + + frame = create_frame (THIS, THIS->ctx->pool); + if (!frame) + goto out; + + if (proc->fn) { + ret = proc->fn (frame, THIS, options); + } + +out: + if (options) + dict_unref (options); + + if (ret) { + cli_cmd_sent_status_get (&sent); + if ((sent == 0) && (parse_error == 0)) + cli_out ("Volume profile failed"); + } + + return ret; + +} int cli_cmd_volume_set_cbk (struct cli_state *state, struct cli_cmd_word *word, @@ -1024,6 +1067,11 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_gsync_set_cbk, "Geo-sync operations"}, #endif + + { "volume profile <VOLNAME> {start|info|stop}", + cli_cmd_volume_profile_cbk, + "volume profile operations"}, + { NULL, NULL, NULL } }; |