]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
Add support for printing vs area in zns id ns
authorMatias Bjørling <matias.bjorling@wdc.com>
Tue, 23 Jun 2020 14:00:14 +0000 (14:00 +0000)
committerMatias Bjørling <matias.bjorling@wdc.com>
Tue, 23 Jun 2020 14:00:14 +0000 (14:00 +0000)
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
plugins/zns/zns.c

index 7a6da79c3db169696a63443a45ad99e1a0fc1c9c..c75b7c53abcff05859b297fe52acd6ffd19d317c 100644 (file)
@@ -62,6 +62,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
        const char *desc = "Send an ZNS specific Identify Namespace command to "\
                "the given device and report information about the specified "\
                "namespace in varios formats.";
+       const char *vendor_specific = "dump binary vendor fields";
        const char *human_readable = "show identify in readable format";
 
        enum nvme_print_flags flags;
@@ -73,6 +74,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
                char *output_format;
                __u32 namespace_id;
                int human_readable;
+               int vendor_specific;
        };
 
        struct config cfg = {
@@ -81,6 +83,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
 
        OPT_ARGS(opts) = {
                OPT_UINT("namespace-id", 'n', &cfg.namespace_id,  namespace_id),
+               OPT_FLAG("vendor-specific", 'v', &cfg.vendor_specific, vendor_specific),
                OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
                OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable),
                OPT_END()
@@ -93,6 +96,8 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
        flags = validate_output_format(cfg.output_format);
        if (flags < 0)
                goto close_fd;
+       if (cfg.vendor_specific)
+               flags |= VS;
        if (cfg.human_readable)
                flags |= VERBOSE;