From be4dee16c18e262b168c74face54cf17ca13e2f4 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 22 Jul 2010 04:17:35 +0000 Subject: Changes for Dynamic Volume Management Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 1196 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1196 --- cli/src/cli-cmd-volume.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (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 d3960d065..445432ecd 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -36,6 +36,12 @@ extern struct rpc_clnt *global_rpc; extern rpc_clnt_prog_t *cli_rpc_prog; +void +cli_cmd_volume_start_usage () +{ + cli_out ("Usage: volume start "); +} + int cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) @@ -145,6 +151,11 @@ cli_cmd_volume_start_cbk (struct cli_state *state, struct cli_cmd_word *word, goto out; //TODO: Build validation here + if (wordcount < 3) { + cli_cmd_volume_start_usage (); + goto out; + } + volname = (char *)words[2]; GF_ASSERT (volname); @@ -153,7 +164,7 @@ cli_cmd_volume_start_cbk (struct cli_state *state, struct cli_cmd_word *word, } out: - if (ret) + if (ret && volname) cli_out ("Starting Volume %s failed", volname); return ret; -- cgit