Skip to content

Commit

Permalink
fabrics: Do not print device on connect per default
Browse files Browse the repository at this point in the history
During the print code refactoring, the show connect message was enabled
per default. To avoid any regressions in application restore the old
behavior and print only the result when the '-o' option is used.

Fixes: 0576d84 ("fabrics: Move printing functions to the print files")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
  • Loading branch information
igaw committed Jun 14, 2023
1 parent 55d5e54 commit b6319a7
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ int nvmf_connect(const char *desc, int argc, char **argv)
nvme_host_t h;
nvme_ctrl_t c;
int ret;
struct nvme_fabrics_config cfg;
enum nvme_print_flags flags = -1;
enum nvme_print_flags flags;
struct nvme_fabrics_config cfg = { 0 };
char *format = "";

NVMF_ARGS(opts, cfg,
Expand All @@ -873,14 +873,7 @@ int nvmf_connect(const char *desc, int argc, char **argv)
if (ret)
return ret;

if (!strcmp(format, ""))
flags = -1;
else if (!strcmp(format, "normal"))
flags = NORMAL;
else if (!strcmp(format, "json"))
flags = JSON;
else
return -EINVAL;
flags = validate_output_format(format);

if (!subsysnqn) {
fprintf(stderr,
Expand Down Expand Up @@ -969,7 +962,8 @@ int nvmf_connect(const char *desc, int argc, char **argv)
nvme_strerror(errno));
else {
errno = 0;
nvme_show_connect_msg(c, flags);
if (flags != -EINVAL)
nvme_show_connect_msg(c, flags);
}

out_free:
Expand Down

0 comments on commit b6319a7

Please sign in to comment.