[pull] master from linux-nvme:master#234
Merged
Merged
Conversation
Make struct libnvme_global_ctx the first argument of every public libnvmf_registry_* function. Most do not use it yet, but threading it in now lets a future version log via libnvme_msg() or reach per-context state without breaking the ABI again. Each public function rejects a NULL context with -EINVAL; the internal *_instance helpers only forward it and do not re-validate. Also forward-declare the struct in registry.h so the public header is self-contained. While here, fix disconnect_all_match() in fabrics.c to take the caller's context instead of creating one per controller. It also returned -ENOMEM from a function declared bool, which coerces to true and would have disconnected controllers on an allocation failure. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
The python-registry parallel-writes test only passed under the "fork"
multiprocessing start method. Python 3.14 makes "forkserver" the default
on Linux, where the test failed two ways:
- Each child re-imports the test module, which unconditionally created
a fresh NVME_REGISTRY_DIR. The children then wrote to a directory the
parent never reads, so the final value came back as the parent's
initial write.
- The libnvme context was passed as a Process argument. A SwigPyObject
cannot be pickled for spawn/forkserver, and a context is not meant to
be shared across processes anyway.
Reuse an inherited /tmp registry directory instead of always creating a
new one, and have each writer process create its own GlobalCtx. Verified
under fork, forkserver and spawn.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Breaking retrieval in smaller chunks if large chunk fails. Signed-off-by: Leonardo da Cunha <leonardo.da.cunha@solidigm.com>
Removed broken code that once tried to dynamically reduce retrieval chunk size. Dynamic chunk size got moved inside libnvme code. Signed-off-by: Leonardo da Cunha <leonardo.da.cunha@solidigm.com>
Simplify create_common_context by calling setup_common_context. Add to set_fabrics_options to setup_common_context as both callers call it after setup_common_context. Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
hook_parser_next_line used gotos to implement a do-while loop. Replace the gotos with a do-while loop to improve readability. Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
Take the controller as the positional <device> argument on retrieve, update and delete, matching every other nvme command and dropping the odd-one-out -d/--device option. Drop the hard -EPERM block on writing the 'owner' attribute: it protected nothing (root can edit /run/nvme/registry/ directly) yet inconsistently let 'delete' clear ownership anyway. update and delete now confirm before an operation that changes or removes ownership; scripts proceed without prompting. While here, give delete an optional --attr to remove a single attribute (clearer than "update with no value"), and require an explicit --attr on retrieve rather than silently defaulting to 'owner'. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )