Drop tree typedefs and documentation cleanup - #3923
Merged
Merged
Conversation
Use the enum libnvmf_hmac_alg type consistently instead a plain int. Signed-off-by: Daniel Wagner <wagi@monom.org>
The correct prefix is libnvme_, update the name of the function. Signed-off-by: Daniel Wagner <wagi@monom.org>
Add additional information to the owner API related functions. Signed-off-by: Daniel Wagner <wagi@monom.org>
Point out that the return string needs to be freed by the caller. Signed-off-by: Daniel Wagner <wagi@monom.org>
The documentation is incorrect, it either returns a string or NULL. Signed-off-by: Daniel Wagner <wagi@monom.org>
There was a problem hiding this comment.
Pull request overview
Standardizes libnvme APIs on explicit structure pointers and improves type-safe HMAC handling.
Changes:
- Replaces tree and MI pointer typedefs with explicit struct pointers.
- Uses
enum libnvmf_hmac_algthroughout TLS key APIs. - Updates related implementations, plugins, tests, examples, and documentation comments.
Reviewed changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/nvme-print.h |
Updates print interfaces. |
src/nvme-print.c |
Updates print wrappers. |
src/nvme-print-stdout.c |
Updates stdout tree handling. |
src/nvme-print-stdout-top.c |
Updates dashboard tree handling. |
src/nvme-print-json.c |
Updates JSON tree handling. |
src/nvme-pci-ids-win.c |
Updates Windows controller type. |
src/nvme-cmds-common.h |
Updates device filters. |
src/global-ctx.c |
Updates MI endpoint type. |
src/fabrics.c |
Updates fabrics tree handling. |
src/cleanup.h |
Updates controller cleanup type. |
plugins/zns/zns.c |
Updates ZNS tree handling. |
plugins/solidigm/solidigm-get-drive-info.c |
Updates drive object types. |
plugins/sandisk/sandisk-utils.c |
Updates PCI lookup types. |
plugins/keys/keys-plugin.c |
Uses the HMAC enum. |
libnvme/tests/zns.c |
Updates ZNS test types. |
libnvme/tests/tree.c |
Updates tree test types. |
libnvme/tests/tree-fabrics.c |
Updates fabrics tree tests. |
libnvme/tests/test.c |
Updates general test types. |
libnvme/tests/test-fabrics.c |
Updates fabrics test type. |
libnvme/tests/sysfs/tree-scan.c |
Updates scan test types. |
libnvme/tests/psk.c |
Tests enum-based HMAC outputs. |
libnvme/tests/mi.c |
Updates MI test types. |
libnvme/tests/mi-mctp.c |
Updates MCTP test types. |
libnvme/tests/ioctl/discovery.c |
Updates discovery test types. |
libnvme/tests/cpp.cc |
Updates C++ API usage. |
libnvme/src/nvme/tree.c |
Converts tree implementation types. |
libnvme/src/nvme/tree-win.c |
Converts Windows tree types. |
libnvme/src/nvme/tree-linux.c |
Converts Linux tree types. |
libnvme/src/nvme/tree-fabrics.c |
Converts fabrics tree types. |
libnvme/src/nvme/scan.h |
Updates scan API signatures. |
libnvme/src/nvme/scan-win.c |
Updates Windows scan signatures. |
libnvme/src/nvme/scan-linux.c |
Updates Linux scan signatures. |
libnvme/src/nvme/private.h |
Updates private declarations. |
libnvme/src/nvme/private-tree.h |
Updates private tree declarations. |
libnvme/src/nvme/private-fabrics.h |
Updates fabrics hook signature. |
libnvme/src/nvme/no-fabrics.c |
Updates no-fabrics stubs. |
libnvme/src/nvme/no-crypto.c |
Updates crypto stub types. |
libnvme/src/nvme/mi.h |
Removes the MI endpoint typedef. |
libnvme/src/nvme/mi.c |
Converts MI implementation types. |
libnvme/src/nvme/mi-mctp.c |
Converts MCTP endpoint types. |
libnvme/src/nvme/lib.h |
Improves API documentation. |
libnvme/src/nvme/lib.c |
Updates endpoint cleanup types. |
libnvme/src/nvme/fabrics.h |
Updates public fabrics signatures. |
libnvme/src/nvme/fabrics.c |
Converts fabrics implementation types. |
libnvme/src/nvme/exclusion.c |
Updates exclusion controller type. |
libnvme/src/nvme/crypto.h |
Makes HMAC APIs enum-typed. |
libnvme/src/nvme/crypto.c |
Implements enum-based HMAC handling. |
libnvme/libnvme3/nvme.i |
Updates SWIG wrapper type usage. |
libnvme/examples/telemetry-listen.c |
Updates telemetry example types. |
libnvme/examples/mi-mctp.c |
Updates MI example types. |
libnvme/examples/mi-mctp-csi-test.c |
Updates CSI example types. |
libnvme/examples/mi-mctp-ae.c |
Updates AEM example types. |
libnvme/examples/mi-conf.c |
Updates MI configuration types. |
libnvme/examples/display-tree.c |
Updates tree example types. |
libnvme/examples/display-columnar.c |
Updates columnar example types. |
libnvme/examples/discover-loop.c |
Updates discovery example types. |
discoverd/src/dlp.c |
Updates discovery controller type. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The other parts of the API avoid introducing typedefs which makes the tree API stand out. Let's drop these and use kernel style how to handle types. Signed-off-by: Daniel Wagner <wagi@monom.org>
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.
I let claude review the API and the list of things to cleanup was mostly documentation update and the inconsistency use of typedefs or not. I decided to make it consistent and replace the typedefs and follow the kernel style here.