-
Notifications
You must be signed in to change notification settings - Fork 703
Fix list-subsys filtering #2836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
the documentation should also be updated, that the device name is optional and just a filter. |
|
I tried this from your fix-filter branches from both libnvme & nvme-cli, but do see some discrepancies in behavior here. For e.g. I have 5 NSs from 2 subsystems with one underlying path or controller each: Now when I run list-subsys on a non-existent device from the 1st subsystem, I get the following blank output: I get the same blank output for a non-existent device from a non-existent subsystem too: So your patches are working as expected. But I see a problem when I run list-subsys on a valid device. For e.g. No issues here when no devices are passed to list-subsys, as seen above. But when I run list-subsys on a valid device, I see the following discrepancy: i.e. it mistakenly displays nvme-subsys2 as well above in addition to nvme-subsys1, which is wrong. |
nvme_match_device_filter is used by list-subsys where it is possible to limit the output by providing a block device. The current implementation only matches on subsystem ID level, but this is not what the expectation is from the user. It is expected to limit the output by the block device name. Change the match to use the block device name instead. Signed-off-by: Daniel Wagner <[email protected]>
When using list-subsys with the optional device filter argument, the subsystem might not have any controller associated anymore, it was filtered out. Avoid outputting any whitespace (or empty json data structures) in this case. Signed-off-by: Daniel Wagner <[email protected]>
|
Thanks, I fixed the patch, works for me now: # .build/nvme list-subsys /dev/nvme0n1
nvme-subsys0 - NQN=nqn.1994-11.com.samsung:nvme:PM9B1:M.2:S67VNF0W218998
hostnqn=nqn.2014-08.org.nvmexpress:uuid:befdec4c-2234-11b2-a85c-ca77c773af36
\
+- nvme0 pcie 0000:02:00.0 live
nvme-subsys1 - NQN=nqn.io-1
hostnqn=nqn.2014-08.org.nvmexpress:uuid:befdec4c-2234-11b2-a85c-ca77c773af36
\
after the update # .build/nvme list-subsys /dev/nvme0n1
nvme-subsys0 - NQN=nqn.1994-11.com.samsung:nvme:PM9B1:M.2:S67VNF0W218998
hostnqn=nqn.2014-08.org.nvmexpress:uuid:befdec4c-2234-11b2-a85c-ca77c773af36
\
+- nvme0 pcie 0000:02:00.0 live
|
Depends on: linux-nvme/libnvme#1022
Fixes: #2830