summaryrefslogtreecommitdiffstats
path: root/rpc/block_svc_routines.c
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-03-13 15:46:51 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-03-13 16:47:56 +0530
commit9805b5f31cf7d42684d232790034a2139a46e42b (patch)
treeb1cc0458915fa162ed6f7b5464625928c1c2c6aa /rpc/block_svc_routines.c
parent4b8af9a41e7c357d68b686cf45135a41b58e08cf (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/block_svc_routines.c')
-rw-r--r--rpc/block_svc_routines.c14
1 files changed, 4 insertions, 10 deletions
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;
}