libnvme: rename nvme_ prefix to libnvme_ for non-NVMe-spec functions#14
Draft
libnvme: rename nvme_ prefix to libnvme_ for non-NVMe-spec functions#14
Conversation
The nvme_ prefix should only be used for functions which directly implement parts of the NVMe spec, defined in libnvme/src/nvme/cmds.h and libnvme/src/nvme/types.h. All other header files implement library functionality, so their functions now use the libnvme_ prefix. This renames 366 functions across: - libnvme headers: tree.h, util.h, filters.h, ioctl.h, linux.h, lib.h, mi.h, nbft.h, fabrics.h, accessors.h - libnvme source files (tree.c, util.c, etc.) - nvme-cli source files (fabrics.c, nvme.c, plugins, etc.) - Python SWIG bindings (nvme.i) - Linker export lists (libnvme.ld, accessors.ld) - Documentation (.rst files) - Examples and tests Co-authored-by: igaw <1050803+igaw@users.noreply.github.com> Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/95a4781b-d70d-42d5-b2c9-4d00b1b75433
Copilot
AI
changed the title
[WIP] Refactor function prefixes in libnvme headers
libnvme: rename nvme_ prefix to libnvme_ for non-NVMe-spec functions
Mar 23, 2026
…nerate accessors
- Revert auto-generated .rst documentation files (should not be
manually edited)
- Rename library struct tags: struct nvme_ctrl -> struct libnvme_ctrl,
struct nvme_host -> struct libnvme_host, struct nvme_ns ->
struct libnvme_ns, struct nvme_ns_head -> struct libnvme_ns_head,
struct nvme_path -> struct libnvme_path, struct nvme_subsystem ->
struct libnvme_subsystem, struct nvme_fabric_options ->
struct libnvme_fabric_options. Typedef names (nvme_ctrl_t etc.)
are unchanged.
- Regenerate accessors.h and accessors.c from the renamed struct
definitions in private.h. The generator now produces both
libnvme_-prefixed function names AND struct libnvme_* parameter
types consistently.
- Update SWIG Python bindings (nvme.i): fix %rename, %extend,
%exception, %pythonappend directives and %{%} getter/setter C
function names to use the new struct names.
Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/e223fb67-9a64-4bbd-bcb0-1c946bcd0246
…_ctrl_t etc.) For consistency with the struct tag and function prefix renames, update the typedef names that alias the library structs: nvme_ctrl_t -> libnvme_ctrl_t nvme_host_t -> libnvme_host_t nvme_ns_t -> libnvme_ns_t nvme_ns_head_t -> libnvme_ns_head_t nvme_path_t -> libnvme_path_t nvme_subsystem_t -> libnvme_subsystem_t nvme_scan_filter_t -> libnvme_scan_filter_t All callers in nvme-cli, plugins, examples, tests, and Python SWIG bindings are updated. accessors.h/accessors.c are regenerated from the updated private.h. Co-authored-by: igaw <1050803+igaw@users.noreply.github.com> Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/90c0799b-7c55-4b93-a7a1-9654e4fc9832
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
struct nvme_ctrl→struct libnvme_ctrl, etc.) and regenerate accessorsnvme_ctrl_t→libnvme_ctrl_t,nvme_host_t→libnvme_host_t,nvme_ns_t→libnvme_ns_t,nvme_ns_head_t→libnvme_ns_head_t,nvme_path_t→libnvme_path_t,nvme_subsystem_t→libnvme_subsystem_t,nvme_scan_filter_t→libnvme_scan_filter_tacross all source filesaccessors.h/accessors.cfrom updatedprivate.h⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.