]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: Print full device path
authorDaniel Wagner <dwagner@suse.de>
Thu, 17 Mar 2022 13:22:55 +0000 (14:22 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 17 Mar 2022 14:03:16 +0000 (15:03 +0100)
commit6c9f792f99aa8782b32635c44e3a573bbb36c830
tree376c925d5ce65b940feb16f1701d9fe87d7b975e
parent470e2ff8326d630a735f0a411dd25b1d915a67f3
nvme: Print full device path

Restore nvme-cli 1.x behavior to print the full path to the device
file. We assume that the devtmpfs is mounted under /dev which is the
case for any systemd based distro and a de-facto standard.

But SPDK users see their device populated under /dev/spdk have their
device file appear. So instead blindly prefix /dev do a stat to check
if the file exist.

If our educated guesses fail, don't add the full path. This should be
really a corner case and as long no one complains don't overengineer.

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