diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-03-13 15:46:51 +0530 |
---|---|---|
committer | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-03-13 16:47:56 +0530 |
commit | 9805b5f31cf7d42684d232790034a2139a46e42b (patch) | |
tree | b1cc0458915fa162ed6f7b5464625928c1c2c6aa /rpc | |
parent | 4b8af9a41e7c357d68b686cf45135a41b58e08cf (diff) |
gluster-block: create portal only with ip address
portal create with FQDN or hostname seems to be not working i.e.
iscsiadm fails to discover the nodes or the otherway targetcli is unable
to export the LUN right.
Change-Id: Ibe0e2aa1b365d6c74a7974b2faf502d2c2ac38ad
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/block.h | 2 | ||||
-rw-r--r-- | rpc/block_svc_routines.c | 14 | ||||
-rw-r--r-- | rpc/block_xdr.c | 3 | ||||
-rw-r--r-- | rpc/rpcl/block.x | 1 |
4 files changed, 10 insertions, 10 deletions
diff --git a/rpc/block.h b/rpc/block.h index 4cc510e..fcf6832 100644 --- a/rpc/block.h +++ b/rpc/block.h @@ -8,12 +8,14 @@ #include <rpc/rpc.h> + #ifdef __cplusplus extern "C" { #endif struct blockCreate { + char ipaddr[255]; char volume[255]; char gbid[127]; u_quad_t size; diff --git a/rpc/block_svc_routines.c b/rpc/block_svc_routines.c index 1acff6c..f72ff42 100644 --- a/rpc/block_svc_routines.c +++ b/rpc/block_svc_routines.c @@ -273,6 +273,8 @@ glusterBlockCallRPC_1(char *host, void *cobj, switch(opt) { case CREATE_SRV: + strcpy(((blockCreate *)cobj)->ipaddr, host); + reply = block_create_1((blockCreate *)cobj, clnt); if (!reply) { LOG("mgmt", GB_LOG_ERROR, "%son host %s", @@ -1065,7 +1067,6 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp) { FILE *fp; int ret; - char hostname[255]; char *backstore = NULL; char *iqn = NULL; char *lun = NULL; @@ -1091,16 +1092,9 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp) goto out; } - if (gethostname(hostname, HOST_NAME_MAX)) { - LOG("mgmt", GB_LOG_ERROR, - "gethostname on localhost for block %s on volume %s failed (%s)", - blk->block_name, blk->volume, strerror(errno)); - goto out; - } - if (asprintf(&backstore, "%s %s %s %zu %s@%s%s/%s %s", GB_TGCLI_GLFS, GB_CREATE, blk->block_name, blk->size, blk->volume, - hostname, GB_STOREDIR, blk->gbid, blk->gbid) == -1) { + blk->ipaddr, GB_STOREDIR, blk->gbid, blk->gbid) == -1) { goto out; } @@ -1118,7 +1112,7 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp) if (asprintf(&portal, "%s/%s%s/tpg1/portals create %s", GB_TGCLI_ISCSI, GB_TGCLI_IQN_PREFIX, blk->gbid, - hostname) == -1) { + blk->ipaddr) == -1) { goto out; } diff --git a/rpc/block_xdr.c b/rpc/block_xdr.c index f9d3f63..9a83b42 100644 --- a/rpc/block_xdr.c +++ b/rpc/block_xdr.c @@ -8,6 +8,9 @@ bool_t xdr_blockCreate (XDR *xdrs, blockCreate *objp) { + if (!xdr_vector (xdrs, (char *)objp->ipaddr, 255, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; if (!xdr_vector (xdrs, (char *)objp->volume, 255, sizeof (char), (xdrproc_t) xdr_char)) return FALSE; diff --git a/rpc/rpcl/block.x b/rpc/rpcl/block.x index 06e83f3..e876ba4 100644 --- a/rpc/rpcl/block.x +++ b/rpc/rpcl/block.x @@ -1,4 +1,5 @@ struct blockCreate { + char ipaddr[255]; char volume[255]; char gbid[127]; /* uuid */ u_quad_t size; |