]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: Fix show-topolocy for ctrls
authorDaniel Wagner <dwagner@suse.de>
Wed, 26 Jul 2023 13:44:34 +0000 (15:44 +0200)
committerDaniel Wagner <wagi@monom.org>
Thu, 27 Jul 2023 08:20:01 +0000 (10:20 +0200)
Depending on the ranking command line argument we are supposed to show the
topology order by namespaces or ctrls.

Fixes: 1d583b7856db ("nvme-print-stdout: Refactor stdout print code to use print_ops")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme-print.c

index 4b977c11b8684da40bf1d3a03026f9c2bfe548a7..286e4d55fb23b41e434272c8ef7c919b8cb31647 100644 (file)
@@ -1016,7 +1016,11 @@ void nvme_show_topology(nvme_root_t r,
                        enum nvme_cli_topo_ranking ranking,
                        enum nvme_print_flags flags)
 {
-       nvme_print(topology_namespace, flags, r);
+       if (ranking == NVME_CLI_TOPO_NAMESPACE) {
+               nvme_print(topology_namespace, flags, r);
+       } else {
+               nvme_print(topology_ctrl, flags, r);
+       }
 }
 
 void nvme_show_message(bool error, const char *msg, ...)