diff options
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
| -rw-r--r-- | cli/src/cli-cmd-volume.c | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index cbc249ba0..4dd06422a 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -246,6 +246,8 @@ cli_cmd_volume_stop_cbk (struct cli_state *state, struct cli_cmd_word *word,          call_frame_t            *frame = NULL;          int                     flags   = 0;          gf1_cli_stop_vol_req    req = {0,}; +        char                    answer; +        char                    flush;          frame = create_frame (THIS, THIS->ctx->pool);          if (!frame) @@ -270,6 +272,17 @@ cli_cmd_volume_stop_cbk (struct cli_state *state, struct cli_cmd_word *word,                  }          } +        printf ("Stopping volume will make its data inaccessible. " +                "Do you want to Continue? (y/n) "); +        answer = getchar (); +        flush = answer; +        while ('\n' != flush) +                flush = getchar (); +        if ('y' != answer) { +                ret = 0; +                goto out; +        } +          req.flags = flags;          proc = &cli_rpc_prog->proctable[GF1_CLI_STOP_VOLUME]; @@ -460,6 +473,8 @@ cli_cmd_volume_remove_brick_cbk (struct cli_state *state,          rpc_clnt_procedure_t    *proc = NULL;          call_frame_t            *frame = NULL;          dict_t                  *options = NULL; +        char                    answer; +        char                    flush;          frame = create_frame (THIS, THIS->ctx->pool);          if (!frame) @@ -472,6 +487,17 @@ cli_cmd_volume_remove_brick_cbk (struct cli_state *state,                  goto out;          } +        printf ("Removing brick(s) can result in data loss. " +                "Do you want to Continue? (y/n) "); +        answer = getchar (); +        flush = answer; +        while ('\n' != flush) +                flush = getchar (); +        if ('y' != answer) { +                ret = 0; +                goto out; +        } +          proc = &cli_rpc_prog->proctable[GF1_CLI_REMOVE_BRICK];          if (proc->fn) {  | 
