]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-stdout: update changed-ns-list-log output
authorMartin George <marting@netapp.com>
Tue, 24 Sep 2024 10:51:48 +0000 (16:21 +0530)
committerDaniel Wagner <wagi@monom.org>
Wed, 25 Sep 2024 09:36:43 +0000 (11:36 +0200)
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 <marting@netapp.com>
nvme-print-stdout.c

index 8c8ac5f4b876fa306e1ac25da3457f0c6acfa53b..c93c2e7ebaebd5027638d00b0bad7dabb15b3aaf 100644 (file)
@@ -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);
                }