Skip to content

Commit 5092bd8

Browse files
Prasanna Kumar Kaleverpkalever
Prasanna Kumar Kalever
authored andcommitted
daemon: switch to batch mode when available
latest targetcli daemon approach set interactive mode as default to make it appear similar to cli approach, hence to use previous batch mode we need some global settings. Depends on: open-iscsi/targetcli-fb#167 Reviewed-by: Xiubo Li <[email protected]> Signed-off-by: Prasanna Kumar Kalever <[email protected]>
1 parent 38dade1 commit 5092bd8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

daemon/gluster-blockd.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,17 @@ blockNodeSanityCheck(void)
539539
return ENOMEM;
540540
}
541541
} else {
542-
if (GB_ASPRINTF(&global_opts, "%s auto_use_daemon=true", tmp) == -1) {
543-
GB_FREE(tmp);
544-
return ENOMEM;
542+
ret = gbRunner("targetcli set global | grep daemon_use_batch_mode");
543+
if (!ret) {
544+
if (GB_ASPRINTF(&global_opts, "%s auto_use_daemon=true daemon_use_batch_mode=true", tmp) == -1) {
545+
GB_FREE(tmp);
546+
return ENOMEM;
547+
}
548+
} else {
549+
if (GB_ASPRINTF(&global_opts, "%s auto_use_daemon=true", tmp) == -1) {
550+
GB_FREE(tmp);
551+
return ENOMEM;
552+
}
545553
}
546554
}
547555
GB_FREE(tmp);

0 commit comments

Comments
 (0)