Skip to content

lib: Gave blkdev and chardev checks platform agnostic names.#3281

Closed
bgoing-micron-oss wants to merge 1 commit intolinux-nvme:masterfrom
Micron-TPG-OSS:platform-agnostic-ctrl-and-ns-handle-checks
Closed

lib: Gave blkdev and chardev checks platform agnostic names.#3281
bgoing-micron-oss wants to merge 1 commit intolinux-nvme:masterfrom
Micron-TPG-OSS:platform-agnostic-ctrl-and-ns-handle-checks

Conversation

@bgoing-micron-oss
Copy link
Copy Markdown
Contributor

On Linux, controller devices are character devices, and namespace devices are block devices. This is not true on platforms like Windows.

  • Changed platform-specific libnvme_transport_handle_is_chardev and libnvme_transport_handle_is_blkdev to platform-agnostic libnvme_transport_handle_is_ctrl and libnvme_transport_handle_is_ns. This also helps to make the intent of the checks more clear.
  • Changed error messages to use platform-agnostic controller/namespace wording as well.

@bgoing-micron-oss
Copy link
Copy Markdown
Contributor Author

@igaw This is the change we discussed last week to make checking the handle type platform agnostic and based on the intended use rather than whether it is block device or character device.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Apr 16, 2026

Looks good to me. I wonder if we should just extend the help text to something like

"ERROR : The NVMe namespace device (e.g. /dev/nvme0n1) must be specified\n");

FWIW, we can even make the example platform specific later.

@bgoing-micron-oss bgoing-micron-oss force-pushed the platform-agnostic-ctrl-and-ns-handle-checks branch from 4e14e8f to ed1d289 Compare April 16, 2026 19:29
On Linux, controller devices are character devices, and namespace
devices are block devices.  This is not true on platforms like Windows.
- Changed platform-specific libnvme_transport_handle_is_chardev and
libnvme_transport_handle_is_blkdev to platform-agnostic
libnvme_transport_handle_is_ctrl and libnvme_transport_handle_is_ns.
This also helps to make the intent of the checks more clear.
- Changed error messages to use platform-agnostic controller/namespace
wording as well.

Signed-off-by: Broc Going <bgoing@micron.com>
@bgoing-micron-oss bgoing-micron-oss force-pushed the platform-agnostic-ctrl-and-ns-handle-checks branch from ed1d289 to 43f276c Compare April 16, 2026 19:39
@bgoing-micron-oss
Copy link
Copy Markdown
Contributor Author

@igaw I've updated the error string as suggested. I left the error strings in nvme.c unchanged because they seemed consistent with the other error strings, but I updated the main help string which shows examples of controller and namespace device names. If you would like further changes, let me know. Thanks.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Apr 17, 2026

I've changed the commit messages to present tense to keep it consist with the rest and applied it directly. Thanks!

@igaw igaw closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants