summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2016-08-22 12:11:24 -0400
committerVijay Bellur <vbellur@redhat.com>2016-08-27 21:27:18 -0700
commita5212486efb94583fde62b575508a945cdfb66e2 (patch)
treeb1318ef9bb9b9dc9e39cd44baaad0808a6245d73 /cli
parente80ada68059037282a32d296fffed18e01f836a0 (diff)
cli: fix unused variable warnings/errors
http://review.gluster.org/14085 fixes a/the "leak" - via the generated rpc/xdr headers - of pragmas that mask these warnings. However 14085 won't pass the smoke test until all the warnings are fixed. Change-Id: Ifc33762cf62259961ceb35ae9ac3cbec7094b703 BUG: 1369124 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15238 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c12
-rw-r--r--cli/src/cli-cmd-volume.c5
-rw-r--r--cli/src/cli-rpc-ops.c37
-rw-r--r--cli/src/cli-xml-output.c23
4 files changed, 9 insertions, 68 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 20dcda5619e..e0a92ddbc6e 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -436,7 +436,6 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
char *volname = NULL;
int ret = -1;
gf1_cluster_type type = GF_CLUSTER_TYPE_NONE;
- int count = 1;
int sub_count = 1;
int brick_index = 0;
char *trans_type = NULL;
@@ -447,7 +446,6 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
"redundancy", "disperse-data", "arbiter", NULL };
char *w = NULL;
- char *ptr = NULL;
int op_count = 0;
int32_t replica_count = 1;
int32_t arbiter_count = 0;
@@ -644,9 +642,6 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
if (!trans_type)
trans_type = gf_strdup ("tcp");
- /* reset the count value now */
- count = 1;
-
if (index >= wordcount) {
ret = -1;
goto out;
@@ -832,10 +827,8 @@ cli_cmd_ganesha_parse (struct cli_state *state,
{
dict_t *dict = NULL;
int ret = -1;
- int flags = 0;
char *key = NULL;
char *value = NULL;
- int i = 0;
char *w = NULL;
char *opwords[] = { "enable", "disable", NULL };
const char *question = NULL;
@@ -1918,7 +1911,6 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
char *word = NULL;
dict_t *dict = NULL;
int32_t command = GF_OP_CMD_NONE;
- int force = 0;
dict = dict_new ();
if (!dict)
@@ -3663,8 +3655,6 @@ cli_cmd_volume_heal_options_parse (const char **words, int wordcount,
{
int ret = 0;
dict_t *dict = NULL;
- char *hostname = NULL;
- char *path = NULL;
gf_xl_afr_op_t op = GF_SHD_OP_INVALID;
dict = dict_new ();
@@ -3987,10 +3977,8 @@ int
cli_snap_clone_parse (dict_t *dict, const char **words, int wordcount) {
uint64_t i = 0;
int ret = -1;
- char key[PATH_MAX] = "";
char *clonename = NULL;
unsigned int cmdi = 2;
- int flags = 0;
/* cmdi is command index, here cmdi is "2" (gluster snapshot clone)*/
GF_ASSERT (words);
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 896b1ce5686..020697ff56b 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -194,10 +194,6 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word,
dict_t *options = NULL;
int sent = 0;
int parse_error = 0;
- char *brick_list = NULL;
- int32_t brick_count = 0;
- int32_t sub_count = 0;
- int32_t type = GF_CLUSTER_TYPE_NONE;
cli_local_t *local = NULL;
char *trans_type = NULL;
@@ -1116,7 +1112,6 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,
int ret = -1;
call_frame_t *frame = NULL;
dict_t *options = NULL;
- char *volname = NULL;
rpc_clnt_procedure_t *proc = NULL;
cli_local_t *local = NULL;
int i = 0;
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index a8a26c820dd..6259546b6e9 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -835,7 +835,6 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
int32_t vol_type = 0;
int32_t transport = 0;
char *volume_id_str = NULL;
- char *brick = NULL;
char *volname = NULL;
dict_t *dict = NULL;
cli_local_t *local = NULL;
@@ -1778,7 +1777,6 @@ gf_cli_print_tier_status (dict_t *dict, enum gf_task_types task_type)
char *node_name = NULL;
gf_defrag_status_t status_rcd = GF_DEFRAG_STATUS_NOT_STARTED;
char *status_str = NULL;
- char *size_str = NULL;
gf_boolean_t down = _gf_false;
ret = dict_get_int32 (dict, "count", &count);
@@ -2115,7 +2113,6 @@ gf_cli_reset_volume_cbk (struct rpc_req *req, struct iovec *iov,
gf_cli_rsp rsp = {0,};
int ret = -1;
char msg[1024] = {0,};
- call_frame_t *frame = NULL;
GF_ASSERT (myframe);
@@ -2166,7 +2163,6 @@ gf_cli_ganesha_cbk (struct rpc_req *req, struct iovec *iov,
gf_cli_rsp rsp = {0,};
int ret = -1;
dict_t *dict = NULL;
- char *help_str = NULL;
GF_ASSERT (myframe);
@@ -2972,13 +2968,9 @@ gf_cli_replace_brick_cbk (struct rpc_req *req, struct iovec *iov,
int ret = -1;
cli_local_t *local = NULL;
call_frame_t *frame = NULL;
- char *src_brick = NULL;
- char *dst_brick = NULL;
- char *status_reply = NULL;
char *rb_operation_str = NULL;
dict_t *rsp_dict = NULL;
char msg[1024] = {0,};
- char *task_id_str = NULL;
char *replace_op = 0;
GF_ASSERT (myframe);
@@ -3863,7 +3855,6 @@ gf_cli_quota_cbk (struct rpc_req *req, struct iovec *iov,
int32_t type = 0;
call_frame_t *frame = NULL;
char *default_sl = NULL;
- char *limit_list = NULL;
cli_local_t *local = NULL;
char *default_sl_dup = NULL;
int32_t entry_count = 0;
@@ -4736,12 +4727,9 @@ gf_cli_tier (call_frame_t *frame, xlator_t *this,
void *data)
{
int ret = 0;
- int32_t command = 0;
- int32_t cmd = 0;
gf_cli_req req = { {0,} };
gf_cli_req status_req = { {0,} };
dict_t *dict = NULL;
- char *volname = NULL;
if (!frame || !this || !data) {
ret = -1;
@@ -5849,7 +5837,6 @@ gf_cli_gsync_set_cbk (struct rpc_req *req, struct iovec *iov,
char *master = NULL;
char *slave = NULL;
int32_t type = 0;
- call_frame_t *frame = NULL;
gf_boolean_t status_detail = _gf_false;
GF_ASSERT (myframe);
@@ -5858,8 +5845,6 @@ gf_cli_gsync_set_cbk (struct rpc_req *req, struct iovec *iov,
goto out;
}
- frame = myframe;
-
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_cli_rsp);
if (ret < 0) {
gf_log (((call_frame_t *) myframe)->this->name, GF_LOG_ERROR,
@@ -7747,8 +7732,6 @@ cli_print_volume_status_tasks (dict_t *dict)
char key[1024] = {0,};
char task[1024] = {0,};
char *brick = NULL;
- char *src_brick = NULL;
- char *dest_brick = NULL;
ret = dict_get_str (dict, "volname", &volname);
if (ret)
@@ -9921,8 +9904,6 @@ cli_populate_req_dict_for_delete (dict_t *snap_dict, dict_t *dict, size_t index)
int32_t ret = -1;
char key[PATH_MAX] = "";
char *buffer = NULL;
- int type = 0;
- int snapcount = 0;
GF_ASSERT (snap_dict);
GF_ASSERT (dict);
@@ -9970,12 +9951,11 @@ out:
}
int
-cli_populate_req_dict_for_status (dict_t *snap_dict, dict_t *dict, int index) {
+cli_populate_req_dict_for_status (dict_t *snap_dict, dict_t *dict, int index)
+{
int ret = -1;
char key[PATH_MAX] = "";
char *buffer = NULL;
- int type = 0;
- int snapcount = 0;
GF_ASSERT (snap_dict);
GF_ASSERT (dict);
@@ -10403,7 +10383,6 @@ gf_cli_snapshot_for_delete (call_frame_t *frame, xlator_t *this,
void *data)
{
gf_cli_req req = {{0,}};
- dict_t *options = NULL;
int32_t ret = -1;
int32_t cmd = -1;
cli_local_t *local = NULL;
@@ -10421,8 +10400,6 @@ gf_cli_snapshot_for_delete (call_frame_t *frame, xlator_t *this,
local = frame->local;
- options = data;
-
ret = dict_get_int32 (local->dict, "sub-cmd", &cmd);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to get "
@@ -10532,7 +10509,6 @@ gf_cli_snapshot_for_status (call_frame_t *frame, xlator_t *this,
{
gf_cli_req req = {{0,}};
- dict_t *options = NULL;
int ret = -1;
int32_t cmd = -1;
cli_local_t *local = NULL;
@@ -10546,7 +10522,6 @@ gf_cli_snapshot_for_status (call_frame_t *frame, xlator_t *this,
GF_VALIDATE_OR_GOTO ("cli", data, out);
local = frame->local;
- options = data;
ret = dict_get_int32 (local->dict, "sub-cmd", &cmd);
if (ret) {
@@ -10695,12 +10670,12 @@ xmlend:
out:
if (ret && local && GF_SNAP_OPTION_TYPE_STATUS == type) {
tmp_ret = dict_get_str (local->dict, "op_err_str", &err_str);
- if (err_str) {
+ if (tmp_ret || !err_str) {
+ cli_err ("Snapshot Status : failed: %s", "Please "
+ "check log file for details");
+ } else {
cli_err ("Snapshot Status : failed: %s", err_str);
dict_del (local->dict, "op_err_str");
- } else {
- cli_err ("Snapshot Status : failed: %s", "Please "
- "check log file for details");
}
}
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index a91e5e435af..f2b1941b77b 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -2563,14 +2563,10 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
char *caps = NULL;
int k __attribute__((unused)) = 0;
int index = 1;
- int start_index = 1;
- int vol_type = -1;
int tier_vol_type = 0;
- /*hot disperse count, redundancy count and dist count are always
- * zero so need for them to be included in the array.*/
- int hot_disperse_count = 0;
+ /* hot dist count is always zero so need for it to be
+ * included in the array.*/
int hot_dist_count = 0;
- int hot_redundancy_count = 0;
values c = 0;
char *keys[MAX] = {
[COLD_BRICK_COUNT] = "volume%d.cold_brick_count",
@@ -2980,7 +2976,7 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)
value[COLD_BRICK_COUNT]);
}
- start_index = index = value[HOT_BRICK_COUNT] + 1;
+ index = value[HOT_BRICK_COUNT] + 1;
while (index <= brick_count) {
snprintf (key, 1024, "volume%d.brick%d", i,
@@ -3870,10 +3866,6 @@ cli_xml_output_vol_replace_brick (char *op, dict_t *dict,
{
#if (HAVE_LIB_XML)
int ret = -1;
- int status = 0;
- uint64_t files = 0;
- char *current_file = 0;
- char *task_id_str = NULL;
xmlTextWriterPtr writer = NULL;
xmlDocPtr doc = NULL;
@@ -4190,7 +4182,6 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
int closed = 1;
int session_closed = 1;
gf_gsync_status_t **status_values = NULL;
- gf_boolean_t status_detail = _gf_false;
char status_value_name[PATH_MAX] = "";
char *tmp = NULL;
char *volume = NULL;
@@ -4230,9 +4221,6 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
if (ret)
goto out;
- status_detail = dict_get_str_boolean (dict, "status-detail",
- _gf_false);
-
status_values = GF_CALLOC (count, sizeof (gf_gsync_status_t *),
gf_common_mt_char);
if (!status_values) {
@@ -4838,7 +4826,6 @@ cli_xml_snapshot_info_snap_vol (xmlTextWriterPtr writer, xmlDocPtr doc,
{
char key [PATH_MAX] = "";
char *buffer = NULL;
- int value = 0;
int ret = -1;
GF_ASSERT (dict);
@@ -5031,7 +5018,6 @@ cli_xml_snapshot_info (xmlTextWriterPtr writer, xmlDocPtr doc, dict_t *dict)
int i = 0;
int snapcount = 0;
char key [PATH_MAX] = "";
- char *str_value = NULL;
gf_boolean_t snap_driven = _gf_false;
GF_ASSERT (writer);
@@ -5112,7 +5098,6 @@ cli_xml_snapshot_volume_status (xmlTextWriterPtr writer, xmlDocPtr doc,
int ret = -1;
int brickcount = 0;
int i = 0;
- int value = 0;
int pid = 0;
char *buffer = NULL;
char key[PATH_MAX] = "";
@@ -5256,7 +5241,6 @@ cli_xml_snapshot_status_per_snap (xmlTextWriterPtr writer, xmlDocPtr doc,
dict_t *dict, const char *keyprefix)
{
int ret = -1;
- int snapcount = 0;
int volcount = 0;
int i = 0;
char *buffer = NULL;
@@ -5351,7 +5335,6 @@ cli_xml_snapshot_status (xmlTextWriterPtr writer, xmlDocPtr doc, dict_t *dict)
int snapcount = 0;
int i = 0;
int status_cmd = 0;
- char *str_value = NULL;
char key [PATH_MAX] = "";
GF_ASSERT (writer);