-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fabrics: Simple URI parser #820
Conversation
1028d7b
to
4055d3a
Compare
A very simple URI parser implementing URI syntax described in the Boot Specification, rev. 1.0. Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Simple testcase both for valid and malformed URI strings. Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
This adds support for unescaping percent-encoded URI parts. Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
I think this is ready for review. |
As a side note - while this work was initiated by the need from the NVM Express Boot Specification, I believe this libnvme URI parser could serve more general needs. There's simply so much potential in using URI as an alternative to the usual set of parameters. Perhaps more attractive to high-level/end-user-facing tools than low-level tools like nvme-cli. What about nvme-stas, any plans for using URIs, @martin-belanger ? I haven't noticed any other mention elsewhere than in the Boot Specification. My primary concern is whether this API is universal enough before it's released and frozen. Alternatively, this might be moved into nvme-cli as a private API for |
Hi @tbzatek - nvme-stas currently supports URIs read from NBFT records. We convert URIs into the familiar Ref: https://github.com/linux-nvme/nvme-stas/blob/main/staslib/conf.py#L804 |
I see, fair enough :-) I was originally considering using the uriparser C library but since it would be pulled in as dependency and we need to pack nvme-cli in initramfs, it was a no-go. Not to mention supporting old distros where we do regular rebases (RHEL 9). |
I think we start with what you came up and see how it works out. In the worst case we introduce |
Thanks! |
This is an initial implementation for a simple URI parser. Described in NVM Express Boot Specification (TP8012), used in
struct nbft_info_discovery
as a composite connection string, as opposed e.g. to separate struct fields instruct nbft_info_subsystem_ns
.Open questions/TODO:
any UTF-8 related tasks? (can't think of any right now)i.e. as defined in RFC 3986:
Applied to NVMe:
Since the above tasks may involve
struct nvme_fabrics_uri
element changes, marking as WIP, seeking initial feedback. Any other possible elements to extract that I missed?