]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Remove intel specific log from top-level commands
authorKeith Busch <keith.busch@intel.com>
Tue, 29 Nov 2016 22:42:40 +0000 (15:42 -0700)
committerKeith Busch <keith.busch@intel.com>
Tue, 6 Dec 2016 20:55:30 +0000 (13:55 -0700)
Vendor specific plugins should be used for vendor specific logs, and
Intel already provides one.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme-builtin.h
nvme.c

index dc314cbbb37146d957357a5ce6878190fd2946b5..5a26f692659551d2f9409ce01115f3ccd967126a 100644 (file)
@@ -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 8e78ad580bce278dbe3b8e66f17da2cd4ae760c3..55b41f86e914e1b239a0b91111920b15aea71534 100644 (file)
--- 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 "\