Skip to content

Commit

Permalink
nvme-print-stdout: update changed-ns-list-log output
Browse files Browse the repository at this point in the history
The changed-ns-list-log command currently prints nothing for
scenarios where there are no changed ns in the log data. Print a
meaningful message for the same.

Signed-off-by: Martin George <[email protected]>
  • Loading branch information
martin-gpy authored and igaw committed Sep 25, 2024
1 parent de323e3 commit c7ce9e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -3768,8 +3768,10 @@ static void stdout_changed_ns_list_log(struct nvme_ns_list *log,
if (log->ns[0] != cpu_to_le32(NVME_NSID_ALL)) {
for (i = 0; i < NVME_ID_NS_LIST_MAX; i++) {
nsid = le32_to_cpu(log->ns[i]);
if (nsid == 0)
if (nsid == 0) {
printf("no ns changed\n");
break;
}

printf("[%4u]:%#x\n", i, nsid);
}
Expand Down

0 comments on commit c7ce9e9

Please sign in to comment.