Skip to content

Commit 2307205

Browse files
committed
fabrics: only print success message with verbose level
The canonical behavior of shell tools is not to print anything on success. The problem with the connect command here it will always print the device on success. This mixes with the --dump-config command which also writes to stdout and makes the output unusable without additional processing for a config file. Signed-off-by: Daniel Wagner <dwagner@suse.de>
1 parent c43c6a9 commit 2307205

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fabrics.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ int nvmf_connect(const char *desc, int argc, char **argv)
10841084
};
10851085

10861086
c = lookup_ctrl(h, &trcfg);
1087-
if (c && nvme_ctrl_get_name(c) && !cfg.duplicate_connect) {
1087+
if (c && nvme_ctrl_get_name(c) && !cfg.duplicate_connect &&
1088+
log_level >= LOG_INFO) {
10881089
fprintf(stderr, "already connected\n");
10891090
errno = EALREADY;
10901091
goto out_free;
@@ -1109,7 +1110,7 @@ int nvmf_connect(const char *desc, int argc, char **argv)
11091110
nvme_strerror(errno));
11101111
else {
11111112
errno = 0;
1112-
if (flags != -EINVAL)
1113+
if (flags != -EINVAL && log_level >= LOG_INFO)
11131114
nvme_show_connect_msg(c, flags);
11141115
}
11151116

0 commit comments

Comments
 (0)