File 0027-nvme-cli-Remove-unnecessary-nsid-field-in-error-log.patch of Package nvme-cli.10193
From a87393928cbf7890249197396ad5ad2ba060659d Mon Sep 17 00:00:00 2001
From: Minwoo Im <minwoo.im.dev@gmail.com>
Date: Wed, 10 Jan 2018 20:04:45 +0900
Subject: nvme-cli: Remove unnecessary nsid field in error-log
Git-commit: 307929b2641ee974e71f6b14d80da5ebed21e507
References: bsc#1076004
Error information log page is global to controller.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
nvme-ioctl.c | 3 +--
nvme-ioctl.h | 3 +--
nvme.c | 10 +++-------
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/nvme-ioctl.c b/nvme-ioctl.c
index 75e4f24..bf86c23 100644
--- a/nvme-ioctl.c
+++ b/nvme-ioctl.c
@@ -405,8 +405,7 @@ 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, 0, NVME_LOG_ERROR, entries * sizeof(*err_log), err_log);
}
diff --git a/nvme-ioctl.h b/nvme-ioctl.h
index 263ccd9..1758c4f 100644
--- a/nvme-ioctl.h
+++ b/nvme-ioctl.h
@@ -84,8 +84,7 @@ 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 2484ca3..7513947 100644
--- a/nvme.c
+++ b/nvme.c
@@ -228,29 +228,25 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug
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 },
@@ -288,7 +284,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));
--
2.13.7