]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-json: Print persistent_event_log no log data result correctly
authorTokunori Ikegami <ikegami.t@gmail.com>
Fri, 13 Oct 2023 09:17:04 +0000 (18:17 +0900)
committerDaniel Wagner <wagi@monom.org>
Thu, 16 Nov 2023 10:05:54 +0000 (11:05 +0100)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme-print-json.c

index b5afa2cb896ff76945975194897c1e11dc72daed..340ca87f3a32120bec481a532f6527b4f1b63c4c 100644 (file)
@@ -1241,9 +1241,10 @@ static void json_persistent_event_log(void *pevent_log_info, __u8 action,
                        json_add_bitmap(i, pevent_log_head->seb[i], root);
                }
        } else {
-               printf("No log data can be shown with this log len at least " \
-                       "512 bytes is required or can be 0 to read the complete "\
-                       "log page after context established\n");
+               root_add_str(result_str, "No log data can be shown with this log len at least " \
+                            "512 bytes is required or can be 0 to read the complete "\
+                            "log page after context established\n");
+               json_print(root);
                return;
        }
        for (int i = 0; i < le32_to_cpu(pevent_log_head->tnev); i++) {