]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Update nvme.c
authorSami Waheed <samiWaheed@users.noreply.github.com>
Thu, 20 Jan 2022 01:31:29 +0000 (17:31 -0800)
committerGitHub <noreply@github.com>
Thu, 20 Jan 2022 01:31:29 +0000 (17:31 -0800)
list-ctrl should support CNS values of 12h and 13h.  The support for CNS=13h was dropped from 2.0 version

nvme.c

diff --git a/nvme.c b/nvme.c
index b3caa523dbb97a405b76422a75fa8fee3355a88a..6274908699d8f471560ded56719b25f0dcf01a2b 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1816,8 +1816,11 @@ static int list_ctrl(int argc, char **argv, struct command *cmd, struct plugin *
                err = -ENOMEM;
                goto close_fd;
        }
-
-       err = nvme_identify_nsid_ctrl_list(fd, cfg.namespace_id,
+       
+       if (cfg.namespace_id == NVME_NSID_NONE)
+                 err = nvme_identify_ctrl_list(fd, cfg.cntid, cntlist);
+        else
+                 err = nvme_identify_nsid_ctrl_list(fd, cfg.namespace_id,
                                           cfg.cntid, cntlist);
        if (!err)
                nvme_show_list_ctrl(cntlist, flags);