Skip to content

Commit

Permalink
nbft: Include SSNS index in error messages
Browse files Browse the repository at this point in the history
In case of complex NBFT tables, multiple messages printed out
start to get confusing. Better to print SSNS indexes for easier
identification in further debugging.

Signed-off-by: Tomas Bzatek <[email protected]>
  • Loading branch information
tbzatek authored and igaw committed Mar 19, 2024
1 parent 0b57791 commit 89372aa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nbft.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,
if (ret == -1 && (*ss)->unavailable) {
if (verbose >= 1)
fprintf(stderr,
"subsystem reported as unavailable, skipping\n");
"SSNS %d reported as unavailable, skipping\n",
(*ss)->index);
continue;
}

Expand Down Expand Up @@ -218,12 +219,14 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,
ret = nvmf_add_ctrl(h, c, cfg);
if (ret == 0 && verbose >= 1)
fprintf(stderr,
"connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n",
"SSNS %d: connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n",
(*ss)->index,
host_traddr);
}

if (ret)
fprintf(stderr, "no controller found\n");
fprintf(stderr, "SSNS %d: no controller found\n",
(*ss)->index);
else {
if (flags == NORMAL)
print_connect_msg(c);
Expand Down

0 comments on commit 89372aa

Please sign in to comment.