Repository navigation
nfs mbt: add a generic external VFS backend to the replayers - #1916
Draft
suniljoshi137 wants to merge 1 commit into
Draft
suniljoshi137 wants to merge 1 commit into
suniljoshi137 wants to merge 1 commit into
Conversation
The NFS model-based trace replayers can only run against the built-in
backends (memfs, diskfs, cairn, linux, io_uring). Add --backend ext, which
loads an out-of-tree VFS module the way the daemon does (by name, optionally
from a shared object path), so such a module can be held to the same model
and corpus as the in-tree backends.
The module is configured through the environment, so the replayers' option
parsing does not change:
CHIMERA_MBT_EXT_NAME module name (required)
CHIMERA_MBT_EXT_PATH shared object to load
CHIMERA_MBT_EXT_CONFIG module config JSON
CHIMERA_MBT_EXT_MOUNT path handed to the module's mount; the first %s is
replaced by the per-trace filesystem name
A module has no mkfs, so each trace is a fresh mount of that path and the
filesystem is not removed afterwards; the module has to give every mount an
empty tree of its own. The template is substituted by hand and never used as
a printf format. Document the option in the VFS module SDK doc and add it to
the replayers' usage text.
Quick-tier test coverage
make coverage CTEST_ARGS="--output-on-failure"Coverage of this pull request's changesThis pull request changes no instrumented source, so there is nothing to measure. |
This branch has not been deployed
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.
Summary
Adds
--backend extto the NFS model-based trace replayers (nfs3_mbt_replayandnfs4_mbt_replay; the aux and drc replayers include the same header and gain the option too, but only the nfs3 and nfs4 ones were exercised). It loads an out-of-tree VFS module the same way the daemon does, so a module built outside this repository can be replayed against the same Quint-generated corpus and model as memfs, diskfs, cairn, linux and io_uring.Why
The replayers hard-code the list of backends. A downstream VFS module (built against
src/vfs/sdk) has no way to reuse the corpus and the in-process server/client harness; it would have to carry a private copy of the replayers or re-implement the harness. With this change it needs only a shared object.How it works
The module is configured through the environment, so none of the replayers' option parsing changes:
CHIMERA_MBT_EXT_NAMECHIMERA_MBT_EXT_PATHCHIMERA_MBT_EXT_CONFIGCHIMERA_MBT_EXT_MOUNT/); the first%sis replaced by the per-trace filesystem nameA module has no
mkfs, so each trace is a fresh mount of that path and the filesystem is not removed at the end of the trace (rmfsis skipped). The module therefore has to give every mount an empty tree of its own, for example by mounting a new subdirectory per trace. The mount template comes from the environment and is substituted by hand, never used as a printf format. The option is documented indocs/vfs-module-sdk.mdand added to the replayers' usage text.Built-in behaviour is unchanged: the new code is only reached when
--backend extis given.Testing
On Ubuntu 24.04, release build, cairn and GSSAPI off (no rocksdb/krb5 headers on the build host), against
mainat 38fcd25:uncrustify0.78.1 withetc/uncrustify.cfgreports no formatting issue in any touched C/H file.nfs4_mbt_replay --trace-dir <corpus>/nfs4/memfs41_rootandnfs3_mbt_replay --trace-dir <corpus>/nfs3/refon memfs: exit 0, all traces replayed, as before.--backend extwithoutCHIMERA_MBT_EXT_NAMEexits with--backend ext needs CHIMERA_MBT_EXT_NAME.module ... was built against VFS SDK version 6; this chimera provides version 7, which is the expected version check.Not run: the full
make checksweep (debug build, scan-build, reuse-lint, copyright-check) and the extended tier.Notes for review
--backend extis treated like a new backend by the replayers' strictness logic: the checks that are relaxed for the built-in passthrough backends (linux,io_uring) are keyed on the backend name, so an external module is held to the strict model. Say if you would rather it were configurable.