From 6e1449e5201591bbfcd0effa94f221317ad46a7a Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Sat, 21 Dec 2013 23:35:19 +0530 Subject: cli: Throw a warning during creation of rdma volumes. Change-Id: I77155a7a4ff56a10079aab206af197e9d03e8a8a BUG: 1017176 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/6557 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System --- cli/src/cli-cmd-volume.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f3b1828a0..c3ef42071 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -349,6 +349,11 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word, int32_t sub_count = 0; int32_t type = GF_CLUSTER_TYPE_NONE; cli_local_t *local = NULL; + char *trans_type = NULL; + char *question = "RDMA transport is" + " recommended only for testing purposes" + " in this release. Do you want to continue?"; + gf_answer_t answer = GF_ANSWER_NO; proc = &cli_rpc_prog->proctable[GLUSTER_CLI_CREATE_VOLUME]; @@ -395,6 +400,22 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word, } } + + ret = dict_get_str (options, "transport", &trans_type); + if (ret) { + gf_log("cli", GF_LOG_ERROR, "Unable to get transport type"); + goto out; + } + + if (strcasestr (trans_type, "rdma")) { + answer = + cli_cmd_get_confirmation (state, question); + if (GF_ANSWER_NO == answer) { + ret = 0; + goto out; + } + } + if (state->mode & GLUSTER_MODE_WIGNORE) { ret = dict_set_int32 (options, "force", _gf_true); if (ret) { -- cgit