summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rpc-ops.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:56:09 -0700
commit8708953fa3d9187997dc6d484dae663b4469c7ca (patch)
tree38e9ef4db291ee0c1c50805bc08aee6fa3c7780f /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
parent08586ee518de438fe2bbbaa74ae4c9a02a5d88cf (diff)
glusterd: Porting left out log messages to new framework
This is a backport of http://review.gluster.org/11388 cherry-picked from commit 23c1e6dc0fa86c014e1a8b6aa5729675f6d69017 >Change-Id: I70d40ae3b5f49a21e1b93f82885cd58fa2723647 >BUG: 1235538 >Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Change-Id: I70d40ae3b5f49a21e1b93f82885cd58fa2723647 BUG: 1217722 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/11422 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index e987208cfe0..49c1c9ce2cc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -248,7 +248,8 @@ __glusterd_probe_cbk (struct rpc_req *req, struct iovec *iov,
goto out;
}
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_PROBE_REQ_RESP_RCVD,
"Received probe resp from uuid: %s, host: %s",
uuid_utoa (rsp.uuid), rsp.hostname);
if (rsp.op_ret != 0) {
@@ -275,7 +276,8 @@ __glusterd_probe_cbk (struct rpc_req *req, struct iovec *iov,
peerinfo = glusterd_peerinfo_find (rsp.uuid, rsp.hostname);
if (peerinfo == NULL) {
ret = -1;
- gf_log (this->name, GF_LOG_ERROR, "Could not find peerd %s(%s)",
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_PEER_NOT_FOUND, "Could not find peerd %s(%s)",
rsp.hostname, uuid_utoa (rsp.uuid));
goto unlock;
}
@@ -358,7 +360,8 @@ reply:
goto unlock;
} else if (strncasecmp (rsp.hostname, peerinfo->hostname, 1024)) {
- gf_log (THIS->name, GF_LOG_INFO, "Host: %s with uuid: %s "
+ gf_msg (THIS->name, GF_LOG_INFO, 0,
+ GD_MSG_HOST_PRESENT_ALREADY, "Host: %s with uuid: %s "
"already present in cluster with alias hostname: %s",
rsp.hostname, uuid_utoa (rsp.uuid), peerinfo->hostname);
@@ -407,7 +410,8 @@ cont:
ret = glusterd_friend_sm_inject_event (event);
- gf_log ("glusterd", GF_LOG_INFO, "Received resp to probe req");
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_PROBE_REQ_RESP_RCVD, "Received resp to probe req");
unlock:
rcu_read_unlock ();
@@ -468,7 +472,8 @@ __glusterd_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
op_ret = rsp.op_ret;
op_errno = rsp.op_errno;
- gf_log ("glusterd", GF_LOG_INFO,
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_RESPONSE_INFO,
"Received %s from uuid: %s, host: %s, port: %d",
(op_ret)?"RJT":"ACC", uuid_utoa (rsp.uuid), rsp.hostname, rsp.port);
@@ -585,7 +590,8 @@ __glusterd_friend_remove_cbk (struct rpc_req * req, struct iovec *iov,
op_ret = rsp.op_ret;
op_errno = rsp.op_errno;
- gf_log ("glusterd", GF_LOG_INFO,
+ gf_msg ("glusterd", GF_LOG_INFO, 0,
+ GD_MSG_RESPONSE_INFO,
"Received %s from uuid: %s, host: %s, port: %d",
(op_ret)?"RJT":"ACC", uuid_utoa (rsp.uuid), rsp.hostname, rsp.port);
@@ -681,7 +687,8 @@ __glusterd_friend_update_cbk (struct rpc_req *req, struct iovec *iov,
ret = 0;
out:
- gf_log (this->name, GF_LOG_INFO, "Received %s from uuid: %s",
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_RESPONSE_INFO, "Received %s from uuid: %s",
(ret)?"RJT":"ACC", uuid_utoa (rsp.uuid));
GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
@@ -1521,7 +1528,8 @@ glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
if (!peerinfo) {
rcu_read_unlock ();
ret = -1;
- gf_log (this->name, GF_LOG_ERROR, "Could not find peer %s(%s)",
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_PEER_NOT_FOUND, "Could not find peer %s(%s)",
event->peername, uuid_utoa (event->peerid));
goto out;
}
@@ -1545,7 +1553,8 @@ glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
"hostname_in_cluster",
peerinfo->hostname);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ GD_MSG_DICT_SET_FAILED,
"Unable to add hostname of the peer");
goto out;
}
@@ -1618,7 +1627,8 @@ glusterd_rpc_friend_remove (call_frame_t *frame, xlator_t *this,
if (!peerinfo) {
rcu_read_unlock ();
ret = -1;
- gf_log (this->name, GF_LOG_ERROR, "Could not find peer %s(%s)",
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_PEER_NOT_FOUND, "Could not find peer %s(%s)",
event->peername, uuid_utoa (event->peerid));
goto out;
}