]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-print-stdout: Support subsys reachable from several hosts
authorDaniel Wagner <dwagner@suse.de>
Mon, 17 Jul 2023 13:35:01 +0000 (15:35 +0200)
committerDaniel Wagner <wagi@monom.org>
Thu, 20 Jul 2023 09:21:07 +0000 (11:21 +0200)
commita660c506906d075e7f37f4a0607fb98cc470c8d7
tree542b53294dcc52b3290ee2bf487c117fe1d0189a
parent234f39f3d1104bc2e45ccd2525ea570eb33f74ab
nvme-print-stdout: Support subsys reachable from several hosts

The host might be connected with several different hostnqn, and
this might result that the same subsystem is visible from several
hosts.

The current code assumes a each subsystem shows up only once. So
we need to iterate over all hosts/subsystem tuples and print
them accordingly.

Use hash tables to avoid triple loop iterations. Also using strset sorts
all the names alphabetically which is also nice to have.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme-print-stdout.c