summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorNandaja Varma <nandaja.varma@gmail.com>2015-06-25 00:57:00 +0530
committerKaushal M <kaushal@redhat.com>2015-06-26 23:32:01 -0700
commit911e9228f31e89fe5df6e2282ce449b2a94c42b1 (patch)
tree517bb1fd3d56c6016b21bc394956064ee56294ab /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parent2b9b3ef3b646989bbc0412dca187b3f5fcad3283 (diff)
glusterd: Porting left out log messages to new framework
Change-Id: I70d40ae3b5f49a21e1b93f82885cd58fa2723647 BUG: 1235538 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/11388 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 1dbd82c4364..c4533a13946 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -135,7 +135,9 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
goto out;
}
- gf_log (this->name, GF_LOG_INFO, "Received replace brick req");
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_REPLACE_BRK_REQ_RCVD,
+ "Received replace brick req");
if (cli_req.dict.dict_len) {
/* Unserialize the dictionary */
@@ -192,7 +194,9 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req)
}
gf_msg_debug (this->name, 0, "dst brick=%s", dst_brick);
- gf_log (this->name, GF_LOG_INFO, "Received replace brick commit-force "
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_REPLACE_BRK_COMMIT_FORCE_REQ_RCVD,
+ "Received replace brick commit-force "
"request operation");
ret = glusterd_mgmt_v3_initiate_replace_brick_cmd_phases (req,
@@ -387,7 +391,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
ret = dict_set_int32 (rsp_dict, "src-brick-port",
src_brickinfo->port);
if (ret) {
- gf_msg_debug ("", 0,
+ gf_msg_debug (this->name, 0,
"Could not set src-brick-port=%d",
src_brickinfo->port);
}
@@ -426,7 +430,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
if (ret) {
*op_errstr = gf_strdup (msg);
ret = -1;
- gf_log (this->name, GF_LOG_ERROR, "%s", *op_errstr);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_BRICK_VALIDATE_FAIL, "%s", *op_errstr);
goto out;
}
@@ -562,7 +567,8 @@ rb_update_srcbrick_port (glusterd_volinfo_t *volinfo,
src_brickinfo->port = src_port;
if (gf_is_local_addr (src_brickinfo->hostname)) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_BRK_PORT_NO_ADD_INDO,
"adding src-brick port no");
if (volinfo->transport_type == GF_TRANSPORT_RDMA) {
@@ -575,7 +581,8 @@ rb_update_srcbrick_port (glusterd_volinfo_t *volinfo,
src_brickinfo->port = pmap_registry_search (this,
brickname, GF_PMAP_PORT_BRICKSERVER);
if (!src_brickinfo->port) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SRC_BRICK_PORT_UNAVAIL,
"Src brick port not available");
ret = -1;
goto out;
@@ -585,7 +592,7 @@ rb_update_srcbrick_port (glusterd_volinfo_t *volinfo,
ret = dict_set_int32 (rsp_dict, "src-brick-port",
src_brickinfo->port);
if (ret) {
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
"Could not set src-brick port no");
goto out;
}
@@ -595,7 +602,7 @@ rb_update_srcbrick_port (glusterd_volinfo_t *volinfo,
ret = dict_set_int32 (req_dict, "src-brick-port",
src_brickinfo->port);
if (ret) {
- gf_log (this->name, GF_LOG_DEBUG,
+ gf_msg_debug (this->name, 0,
"Could not set src-brick port no");
goto out;
}
@@ -621,14 +628,15 @@ rb_update_dstbrick_port (glusterd_brickinfo_t *dst_brickinfo, dict_t *rsp_dict,
dst_brickinfo->port = dst_port;
if (gf_is_local_addr (dst_brickinfo->hostname)) {
- gf_log ("", GF_LOG_INFO,
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_BRK_PORT_NO_ADD_INDO,
"adding dst-brick port no");
if (rsp_dict) {
ret = dict_set_int32 (rsp_dict, "dst-brick-port",
dst_brickinfo->port);
if (ret) {
- gf_log ("", GF_LOG_DEBUG,
+ gf_msg_debug ("glusterd", 0,
"Could not set dst-brick port no in rsp dict");
goto out;
}
@@ -638,7 +646,7 @@ rb_update_dstbrick_port (glusterd_brickinfo_t *dst_brickinfo, dict_t *rsp_dict,
ret = dict_set_int32 (req_dict, "dst-brick-port",
dst_brickinfo->port);
if (ret) {
- gf_log ("", GF_LOG_DEBUG,
+ gf_msg_debug ("glusterd", 0,
"Could not set dst-brick port no");
goto out;
}
@@ -732,7 +740,7 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
out:
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
return ret;
}
@@ -837,7 +845,7 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
}
if (gf_is_local_addr (dst_brickinfo->hostname)) {
- gf_log (this->name, GF_LOG_DEBUG, "I AM THE DESTINATION HOST");
+ gf_msg_debug (this->name, 0, "I AM THE DESTINATION HOST");
ret = rb_kill_destination_brick (volinfo, dst_brickinfo);
if (ret) {
gf_msg (this->name, GF_LOG_CRITICAL, 0,
@@ -849,7 +857,8 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
ret = glusterd_svcs_stop (volinfo);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_NFS_SERVER_STOP_FAIL,
"Unable to stop nfs server, ret: %d", ret);
}