]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvme-cli: Remove unnecessary nsid field in error-log
authorMinwoo Im <minwoo.im.dev@gmail.com>
Wed, 10 Jan 2018 11:04:45 +0000 (20:04 +0900)
committerMinwoo Im <minwoo.im.dev@gmail.com>
Wed, 10 Jan 2018 11:04:45 +0000 (20:04 +0900)
Error information log page is global to controller.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
nvme-ioctl.c
nvme-ioctl.h
nvme.c

index c0d7775bf8f2ed4c1c02ec13b8910b1db691d49d..259fa20f1344900f28d0e5b3e7fa1a2a863c2e1b 100644 (file)
@@ -403,10 +403,9 @@ int nvme_fw_log(int fd, struct nvme_firmware_log_page *fw_log)
        return nvme_get_log(fd, NVME_NSID_ALL, NVME_LOG_FW_SLOT, sizeof(*fw_log), fw_log);
 }
 
-int nvme_error_log(int fd, __u32 nsid, int entries,
-                  struct nvme_error_log_page *err_log)
+int nvme_error_log(int fd, int entries, struct nvme_error_log_page *err_log)
 {
-       return nvme_get_log(fd, nsid, NVME_LOG_ERROR, entries * sizeof(*err_log), err_log);
+       return nvme_get_log(fd, 0, NVME_LOG_ERROR, entries * sizeof(*err_log), err_log);
 }
 
 int nvme_smart_log(int fd, __u32 nsid, struct nvme_smart_log *smart_log)
index 6a3b52b622b28793705c7e7ec970ca800bf57d74..cfafe5831d600520ddd6820c6eddc1c44cf50523 100644 (file)
@@ -81,8 +81,7 @@ int nvme_identify_ns_descs(int fd, __u32 nsid, void *data);
 
 int nvme_get_log(int fd, __u32 nsid, __u8 log_id, __u32 data_len, void *data);
 int nvme_fw_log(int fd, struct nvme_firmware_log_page *fw_log);
-int nvme_error_log(int fd, __u32 nsid, int entries,
-                  struct nvme_error_log_page *err_log);
+int nvme_error_log(int fd, int entries, struct nvme_error_log_page *err_log);
 int nvme_smart_log(int fd, __u32 nsid, struct nvme_smart_log *smart_log);
 int nvme_discovery_log(int fd, struct nvmf_disc_rsp_page_hdr *log, __u32 size);
 
diff --git a/nvme.c b/nvme.c
index c968781f1bf2afac9b61396912718ac4d79472a5..e5a85c1206fc64d21c285397d98fd41c06059914 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -258,29 +258,25 @@ static int get_effects_log(int argc, char **argv, struct command *cmd, struct pl
 static int get_error_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        const char *desc = "Retrieve specified number of "\
-               "error log entries from a given device (or "\
-               "namespace) in either decoded format (default) or binary.";
-       const char *namespace_id = "desired namespace";
+               "error log entries from a given device "\
+               "in either decoded format (default) or binary.";
        const char *log_entries = "number of entries to retrieve";
        const char *raw_binary = "dump in binary format";
        struct nvme_id_ctrl ctrl;
        int err, fmt, fd;
 
        struct config {
-               __u32 namespace_id;
                __u32 log_entries;
                int   raw_binary;
                char *output_format;
        };
 
        struct config cfg = {
-               .namespace_id = NVME_NSID_ALL,
                .log_entries  = 64,
                .output_format = "normal",
        };
 
        const struct argconfig_commandline_options command_line_options[] = {
-               {"namespace-id",  'n', "NUM", CFG_POSITIVE, &cfg.namespace_id,  required_argument, namespace_id},
                {"log-entries",   'e', "NUM", CFG_POSITIVE, &cfg.log_entries,   required_argument, log_entries},
                {"raw-binary",    'b', "",    CFG_NONE,     &cfg.raw_binary,    no_argument,       raw_binary},
                {"output-format", 'o', "FMT", CFG_STRING,   &cfg.output_format, required_argument, output_format },
@@ -318,7 +314,7 @@ static int get_error_log(int argc, char **argv, struct command *cmd, struct plug
                        return ENOMEM;
                }
 
-               err = nvme_error_log(fd, cfg.namespace_id, cfg.log_entries, err_log);
+               err = nvme_error_log(fd, cfg.log_entries, err_log);
                if (!err) {
                        if (fmt == BINARY)
                                d_raw((unsigned char *)err_log, sizeof(err_log));