Skip to content

libnvme: rename nvme_ prefix to libnvme_ for non-NVMe-spec functions#14

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/update-prefixes-in-header-files
Draft

libnvme: rename nvme_ prefix to libnvme_ for non-NVMe-spec functions#14
Copilot wants to merge 4 commits intomasterfrom
copilot/update-prefixes-in-header-files

Conversation

Copy link

Copilot AI commented Mar 23, 2026

  • Rename struct tags (struct nvme_ctrlstruct libnvme_ctrl, etc.) and regenerate accessors
  • Revert auto-generated RST docs
  • Rename typedefs: nvme_ctrl_tlibnvme_ctrl_t, nvme_host_tlibnvme_host_t, nvme_ns_tlibnvme_ns_t, nvme_ns_head_tlibnvme_ns_head_t, nvme_path_tlibnvme_path_t, nvme_subsystem_tlibnvme_subsystem_t, nvme_scan_filter_tlibnvme_scan_filter_t across all source files
  • Regenerated accessors.h/accessors.c from updated private.h
  • Build succeeds, all 51 tests pass (2 expected failures)

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

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
Copilot AI requested a review from igaw March 23, 2026 17:49
Copilot finished work on behalf of igaw March 23, 2026 17:49
…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
Copilot finished work on behalf of igaw March 23, 2026 20:27
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