summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd-mgmt.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-08 09:28:49 +0000
committerAnand Avati <avati@gluster.com>2011-06-08 11:17:12 -0700
commit19f375da5b43f940131623b2f33675aa2b3f5c8a (patch)
tree29f5e51139deb1cfc2462a2a1ef64a100e2c1c4f /glusterfsd/src/glusterfsd-mgmt.c
parentfe4eb7c3ac96218fe151633c5ccd34b7c0bea783 (diff)
fix multiple transport portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2294 (Currently there is no way through cli to make a volume listen on both the transports (socket/rdma)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2294
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 1f5f6485aeb..01bd8a58ffa 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -900,12 +900,51 @@ out:
}
static int
+mgmt_pmap_signin2_cbk (struct rpc_req *req, struct iovec *iov, int count,
+ void *myframe)
+{
+ pmap_signin_rsp rsp = {0,};
+ call_frame_t *frame = NULL;
+ int ret = 0;
+
+ frame = myframe;
+
+ if (-1 == req->rpc_status) {
+ rsp.op_ret = -1;
+ rsp.op_errno = EINVAL;
+ goto out;
+ }
+
+ ret = xdr_to_pmap_signin_rsp (*iov, &rsp);
+ if (ret < 0) {
+ gf_log (frame->this->name, GF_LOG_ERROR, "XDR decode error");
+ rsp.op_ret = -1;
+ rsp.op_errno = EINVAL;
+ goto out;
+ }
+
+ if (-1 == rsp.op_ret) {
+ gf_log (frame->this->name, GF_LOG_ERROR,
+ "failed to register the port with glusterd");
+ goto out;
+ }
+out:
+ STACK_DESTROY (frame->root);
+ return 0;
+
+}
+
+static int
mgmt_pmap_signin_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
{
pmap_signin_rsp rsp = {0,};
call_frame_t *frame = NULL;
int ret = 0;
+ pmap_signin_req pmap_req = {0, };
+ cmd_args_t *cmd_args = NULL;
+ glusterfs_ctx_t *ctx = NULL;
+ char brick_name[PATH_MAX] = {0,};
frame = myframe;
@@ -928,6 +967,27 @@ mgmt_pmap_signin_cbk (struct rpc_req *req, struct iovec *iov, int count,
"failed to register the port with glusterd");
goto out;
}
+
+ ctx = glusterfs_ctx_get ();
+ cmd_args = &ctx->cmd_args;
+
+ if (!cmd_args->brick_port2) {
+ /* We are done with signin process */
+ goto out;
+ }
+
+ snprintf (brick_name, PATH_MAX, "%s.rdma", cmd_args->brick_name);
+ pmap_req.port = cmd_args->brick_port2;
+ pmap_req.brick = brick_name;
+
+ ret = mgmt_submit_request (&pmap_req, frame, ctx, &clnt_pmap_prog,
+ GF_PMAP_SIGNIN, xdr_from_pmap_signin_req,
+ mgmt_pmap_signin2_cbk);
+ if (ret)
+ goto out;
+
+ return 0;
+
out:
STACK_DESTROY (frame->root);