Skip to content

fabrics: move URI data struct to private API#3278

Merged
igaw merged 2 commits intolinux-nvme:masterfrom
igaw:move-fabrics-uri
Apr 16, 2026
Merged

fabrics: move URI data struct to private API#3278
igaw merged 2 commits intolinux-nvme:masterfrom
igaw:move-fabrics-uri

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Apr 16, 2026

Make the URI data structure opaque and provide getter/setters to allow modification and extension later.

While at it, also rename it to match the naming scheme and update the helper functions accordingly.

The next data structure to be moved out of the public API contains string
arrays. Extend the generator to create getter/setters for this type.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
@igaw igaw force-pushed the move-fabrics-uri branch 3 times, most recently from 0d46064 to 8d7e57e Compare April 16, 2026 11:53
@igaw igaw requested a review from Copilot April 16, 2026 11:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the NVMe-oF URI parsed-data structure opaque (moved to private headers) and introduces generated getter/setter accessors so the URI representation can evolve without exposing its layout to public consumers.

Changes:

  • Move the URI struct definition from the public fabrics header to private-fabrics.h and forward-declare it publicly as struct libnvmf_uri.
  • Rename/realign URI helper APIs (libnvmf_uri_parse, libnvmf_uri_free) and update call sites/tests accordingly.
  • Extend the accessor generator to support char ** (NULL-terminated string arrays) and generate deep-copying setters.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
util/cleanup.h Updates cleanup helper to free the renamed opaque URI type.
libnvme/tools/generator/generate-accessors.py Adds char ** support and emits deep-copying setters + adjusted getters.
libnvme/tools/generator/generate-accessors.md Documents new generator capability for string arrays.
libnvme/test/uriparser.c Updates tests to use the new opaque URI API and accessors.
libnvme/src/nvme/private-fabrics.h Introduces the private struct libnvmf_uri definition for internal use + accessor generation.
libnvme/src/nvme/fabrics.h Removes public struct layout and exposes opaque type + renamed parse/free APIs.
libnvme/src/nvme/fabrics.c Renames/updates the URI parser and free routine implementation and internal users.
libnvme/src/nvme/accessors-fabrics.h Adds public accessor prototypes for struct libnvmf_uri.
libnvme/src/nvme/accessors-fabrics.c Adds generated accessor implementations for struct libnvmf_uri.
libnvme/src/libnvmf.ld Updates exported fabrics symbol names for the renamed URI APIs.
libnvme/src/libnvme.ld Stops exporting libnvme_parse_uri.
libnvme/src/accessors-fabrics.ld Exports the new libnvmf_uri_* accessors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libnvme/src/nvme/fabrics.h
Comment thread libnvme/src/nvme/fabrics.h Outdated
Comment thread libnvme/src/libnvme.ld
Comment thread libnvme/src/libnvmf.ld
Comment thread libnvme/src/nvme/fabrics.h Outdated
Make the URI data structure opaque and provide getter/setters to allow
modification and extension later.

While at it, also rename it to match the naming scheme and update the
helper functions accordingly.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
@igaw igaw force-pushed the move-fabrics-uri branch from 8d7e57e to 193ac7e Compare April 16, 2026 12:12
@igaw igaw merged commit d4727ef into linux-nvme:master Apr 16, 2026
29 checks passed
@igaw igaw deleted the move-fabrics-uri branch April 16, 2026 12:14
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