summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-07-07 15:51:38 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-07-07 11:47:36 +0000
commitf2e46779c0175e5063ce07256023f1977b333f2d (patch)
treeaa7c1847314b1d8b2018bcec380db00b9b1347bf /rpc
parentac7674554e02b8d08c61b8cf9530be80eff79bfd (diff)
tcmu: backstore attribute set cmd_time_out=0
currently, runner is not supporting the non-zero cmd timeouts (cmd_time_out !=0) The tcmu cmd timer just fails the kernel command after cmd_time_out seconds, leaving the runner command running. When it is zero, it means do not run the timer, so both the kernel and runner wait for the command to complete. This patch sets the backstore attribute cmd_time_out=0 Change-Id: Ib7a80c82d0aafe345ff4e79ce88dc92848306f4e Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/block_svc_routines.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/rpc/block_svc_routines.c b/rpc/block_svc_routines.c
index 0a98568..5f7370f 100644
--- a/rpc/block_svc_routines.c
+++ b/rpc/block_svc_routines.c
@@ -1942,6 +1942,7 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp)
FILE *fp;
char *tmp = NULL;
char *backstore = NULL;
+ char *backstore_attr = NULL;
char *iqn = NULL;
char *tpg = NULL;
char *lun = NULL;
@@ -1974,6 +1975,12 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp)
goto out;
}
+ if (GB_ASPRINTF(&backstore_attr,
+ "(%s/%s set attribute cmd_time_out=0 > %s || echo > %s)",
+ GB_TGCLI_GLFS, blk->block_name, DEVNULLPATH, DEVNULLPATH) == -1) {
+ goto out;
+ }
+
if (GB_ASPRINTF(&iqn, "%s %s %s%s", GB_TGCLI_ISCSI, GB_CREATE,
GB_TGCLI_IQN_PREFIX, blk->gbid) == -1) {
goto out;
@@ -2040,21 +2047,27 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp)
goto out;
}
if (!tmp) {
- if (GB_ASPRINTF(&exec, "%s && %s && %s && %s %s && %s && %s %s && %s",
- GB_TGCLI_GLOBALS, backstore, iqn, tpg?tpg:"", lun, portal, attr,
- blk->auth_mode?authcred:"", GB_TGCLI_SAVE) == -1) {
+ if (GB_ASPRINTF(&exec, "%s && %s && %s && %s && %s %s && %s && %s %s",
+ GB_TGCLI_GLOBALS, backstore, backstore_attr, iqn, tpg?tpg:"", lun,
+ portal, attr, blk->auth_mode?authcred:"") == -1) {
goto out;
}
tmp = exec;
} else {
- if (GB_ASPRINTF(&exec, "%s && %s && %s && %s %s && %s",
+ if (GB_ASPRINTF(&exec, "%s && %s && %s && %s %s",
tmp, lun, portal, attr,
- blk->auth_mode?authcred:"", GB_TGCLI_SAVE) == -1) {
+ blk->auth_mode?authcred:"") == -1) {
goto out;
}
GB_FREE(tmp);
tmp = exec;
}
+
+ if (GB_ASPRINTF(&exec, "%s && %s", tmp, GB_TGCLI_SAVE) == -1) {
+ goto out;
+ }
+ GB_FREE(tmp);
+
GB_FREE(authcred);
GB_FREE(attr);
GB_FREE(portal);
@@ -2097,6 +2110,7 @@ block_create_1_svc(blockCreate *blk, struct svc_req *rqstp)
GB_FREE(tpg);
GB_FREE(iqn);
GB_FREE(backstore);
+ GB_FREE(backstore_attr);
blockServerDefFree(list);
return reply;