libnvme: rename nvmf_ API prefix to libnvmf_#3263
Conversation
Use the libnvme_ prefix for the library fabrics API. This makes this part of the library consistent with the other parts. The spec API uses nvme_, the rest libnvme_. Signed-off-by: Daniel Wagner <wagi@kernel.org>
There was a problem hiding this comment.
Pull request overview
This PR renames the NVMe-oF (fabrics) library API prefix from nvmf_ to libnvmf_ to align the fabrics layer with the rest of libnvme’s libnvme_*-prefixed APIs, while keeping the spec-facing API under nvme_*.
Changes:
- Renamed public fabrics APIs and types (
nvmf_*→libnvmf_*) across headers, implementation, CLI, plugins, examples, and tests. - Renamed the generated fabrics accessor artifacts and corresponding Meson/tooling references (
nvmf-accessors.*/nvmf-accessors.ld→accessors-fabrics.*/accessors-fabrics.ld). - Updated documentation to reflect the new filenames and API names.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| util/cleanup.h | Updates URI/context cleanup helpers to call libnvmf_* APIs and use struct libnvmf_context. |
| README.md | Updates accessor-generation documentation to new fabrics accessor filenames. |
| plugins/nbft/nbft-plugin.c | Switches NBFT helper calls to libnvmf_nbft_*. |
| nvme-print-stdout.c | Replaces discovery string helpers with libnvmf_* variants (stdout formatting paths). |
| nvme-print-json.c | Replaces discovery string helpers with libnvmf_* variants (JSON formatting paths). |
| libnvme/tools/generator/meson.build | Updates generator target outputs to accessors-fabrics.{h,c} and accessors-fabrics.ld. |
| libnvme/tools/check-public-symbols.py | Updates symbol-check input list to accessors-fabrics.ld. |
| libnvme/test/uriparser.c | Updates URI free call to libnvmf_free_uri. |
| libnvme/test/tree.c | Renames fabrics context struct usage to struct libnvmf_context. |
| libnvme/test/ioctl/discovery.c | Renames discovery args and discovery log APIs to libnvmf_*. |
| libnvme/src/nvme/util.h | Renames exported EXAT iterator declaration to libnvmf_exat_ptr_next. |
| libnvme/src/nvme/util.c | Renames exported EXAT iterator definition to libnvmf_exat_ptr_next. |
| libnvme/src/nvme/tree.c | Renames fabrics config init and context type usage to libnvmf_*. |
| libnvme/src/nvme/private.h | Renames internal fabrics context struct to struct libnvmf_context and updates callbacks/prototypes. |
| libnvme/src/nvme/private-fabrics.h | Renames generated-accessors struct to struct libnvmf_discovery_args and updates comment references. |
| libnvme/src/nvme/json.c | Updates local context type to struct libnvmf_context. |
| libnvme/src/nvme/fabrics.h | Renames public fabrics API prototypes and related opaque types to libnvmf_*. |
| libnvme/src/nvme/fabrics.c | Renames public fabrics API implementations and internal call sites to libnvmf_*. |
| libnvme/src/nvme/cleanup.h | Updates URI cleanup helper to call libnvmf_free_uri. |
| libnvme/src/nvme/accessors-fabrics.h | Updates generated accessor header guard and renames accessor APIs to libnvmf_*. |
| libnvme/src/nvme/accessors-fabrics.c | Updates generated accessor implementation to include new header and rename accessor APIs. |
| libnvme/src/meson.build | Switches build inputs to accessors-fabrics.{h,c} and updates fabrics include list. |
| libnvme/src/libnvmf.ld | Renames exported fabrics symbols listed under the LIBNVMF_3 version block to libnvmf_*. |
| libnvme/src/accessors-fabrics.ld | Renames exported accessor symbols under LIBNVMF_ACCESSORS_3 to libnvmf_*. |
| libnvme/README.md | Updates accessor generation docs and .ld references to new fabrics filenames. |
| libnvme/libnvme/nvme.i | Updates SWIG/Python bindings to call libnvmf_* APIs and use struct libnvmf_discovery_args. |
| libnvme/examples/discover-loop.c | Updates example to use libnvmf_* discovery APIs. |
| fabrics.c | Updates nvme-cli fabrics command implementation to use libnvmf_* APIs and struct libnvmf_context. |
Comments suppressed due to low confidence (1)
libnvme/src/accessors-fabrics.ld:16
LIBNVMF_ACCESSORS_3now exports onlylibnvmf_*accessor symbols. IfLIBNVMF_ACCESSORS_3is already part of a released ABI, removing the previousnvmf_*symbol names is ABI-breaking for existing consumers. Keep the old accessor symbol names under the existing version and add the new ones under a new symbol version, or provide exported compatibility aliases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (inet_ntop(af, libnvmf_adrfam_str(adrfam), dst, size)) | ||
| printf("%s: %s\n", field, dst); |
There was a problem hiding this comment.
print_traddr() ignores its traddr argument and passes libnvmf_adrfam_str(adrfam) (a decoded string like "ipv4") as the address buffer to inet_ntop(). This will produce incorrect output and may read unrelated memory. Use traddr (the raw address bytes) as the second argument to inet_ntop(); if traddr is already a NUL-terminated string, drop the inet_ntop() conversion entirely and print it directly.
| } | ||
|
|
||
| if (inet_ntop(af, nvmf_adrfam_str(adrfam), dst, size)) | ||
| if (inet_ntop(af, libnvmf_adrfam_str(adrfam), dst, size)) |
There was a problem hiding this comment.
obj_add_traddr() ignores its traddr parameter and passes libnvmf_adrfam_str(adrfam) (a human-readable string) as the address buffer to inet_ntop(). This will yield invalid results. Pass traddr (raw address bytes) to inet_ntop() instead, or if traddr is already a string, skip inet_ntop() and add it directly.
| if (inet_ntop(af, libnvmf_adrfam_str(adrfam), dst, size)) | |
| if (inet_ntop(af, traddr, dst, size)) |
Use the libnvme_ prefix for the library fabrics API. This makes this part of the library consistent with the other parts. The spec API uses nvme_, the rest libnvme_.