summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorRahul <rahul@gluster.com>2011-03-17 01:55:43 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-18 20:36:27 -0700
commit3d912aa905105098db1eea1e4c3e9c42aa0c7da7 (patch)
tree2e810624e20526e4a5a1631e0ebb84ef0a3bb655 /cli/src/cli-cmd-volume.c
parent6d8077eb9c7129f4bdb352132e565906568dfb66 (diff)
Added checks for fix-layout & migrate-data usage.
Signed-off-by: Rahul <rahul@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2547 (rebalance command usage and help mis-match) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2547
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 3bd54a6fb3b..f008384ae64 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -463,6 +463,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
dict_t *dict = NULL;
int sent = 0;
int parse_error = 0;
+ int index = 0;
#ifdef GF_SOLARIS_HOST_OS
cli_out ("Command not supported on Solaris");
goto out;
@@ -482,8 +483,20 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
- if (strcmp (words[3], "start") && strcmp (words[3], "stop") &&
- strcmp (words[3], "status")) {
+ if (wordcount == 4) {
+ index = 3;
+ } else {
+ if (strcmp (words[3], "fix-layout") &&
+ strcmp (words[3], "migrate-data")) {
+ cli_usage_out (word->pattern);
+ parse_error = 1;
+ goto out;
+ }
+ index = 4;
+ }
+
+ if (strcmp (words[index], "start") && strcmp (words[index], "stop") &&
+ strcmp (words[index], "status")) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;