From: Keith Busch Date: Tue, 29 Nov 2016 22:42:40 +0000 (-0700) Subject: Remove intel specific log from top-level commands X-Git-Tag: v1.1~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a9d607470b19954a61329074b5e9bebf16d5bcfd;p=users%2Fsagi%2Fnvme-cli.git Remove intel specific log from top-level commands Vendor specific plugins should be used for vendor specific logs, and Intel already provides one. Signed-off-by: Keith Busch --- diff --git a/nvme-builtin.h b/nvme-builtin.h index dc314cbb..5a26f692 100644 --- a/nvme-builtin.h +++ b/nvme-builtin.h @@ -20,7 +20,6 @@ COMMAND_LIST( ENTRY("get-log", "Generic NVMe get log, returns log in raw format", get_log) ENTRY("fw-log", "Retrieve FW Log, show it", get_fw_log) ENTRY("smart-log", "Retrieve SMART Log, show it", get_smart_log) - ENTRY("smart-log-add", "Retrieve additional SMART Log, show it", get_additional_smart_log) ENTRY("error-log", "Retrieve Error Log, show it", get_error_log) ENTRY("get-feature", "Get feature and show the resulting value", get_feature) ENTRY("set-feature", "Set a feature and show the resulting value", set_feature) diff --git a/nvme.c b/nvme.c index 8e78ad58..55b41f86 100644 --- a/nvme.c +++ b/nvme.c @@ -227,59 +227,6 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug return err; } -static int get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) -{ - struct nvme_additional_smart_log smart_log; - int err, fmt, fd; - char *desc = "Get Intel vendor specific additional smart log (optionally, "\ - "for the specified namespace), and show it."; - const char *namespace = "(optional) desired namespace"; - const char *raw = "dump output in binary format"; - struct config { - __u32 namespace_id; - int raw_binary; - char *output_format; - }; - - struct config cfg = { - .namespace_id = 0xffffffff, - .output_format = "normal", - }; - - const struct argconfig_commandline_options command_line_options[] = { - {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id, required_argument, namespace}, - {"raw-binary", 'b', "", CFG_NONE, &cfg.raw_binary, no_argument, raw}, - {"output-format", 'o', "FMT", CFG_STRING, &cfg.output_format, required_argument, output_format }, - {NULL} - }; - - fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg)); - if (fd < 0) - return fd; - - fmt = validate_output_format(cfg.output_format); - if (fmt < 0) - return fmt; - if (cfg.raw_binary) - fmt = BINARY; - - err = nvme_intel_smart_log(fd, cfg.namespace_id, &smart_log); - if (!err) { - if (fmt == BINARY) - d_raw((unsigned char *)&smart_log, sizeof(smart_log)); - if (fmt == JSON) - json_add_smart_log(&smart_log, cfg.namespace_id, devicename); - else - show_intel_smart_log(&smart_log, cfg.namespace_id, devicename); - } - else if (err > 0) - fprintf(stderr, "NVMe Status:%s(%x)\n", - nvme_status_to_string(err), err); - else - perror("intel smart log"); - return err; -} - static int get_error_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) { const char *desc = "Retrieve specified number of "\