Repository navigation
Add WithRootFSShare to boot from the cached rootfs without copying it - #160
Merged
Merged
Conversation
This was referenced Nov 2, 2026
Co-authored-by: Mecatl <noreply@mecatl.dev>
Co-authored-by: Mecatl <noreply@mecatl.dev>
Contributor
|
Pushed two follow-up fixes on top of this PR:
Both commits include regression tests. An independent sol-6.1 worker statically reviewed the actual fixes and found no blocking regressions. Tests, lint, and vet were not run, as requested; runtime/compiler verification remains outstanding. |
jhrozek
approved these changes
Nov 6, 2026
jhrozek
left a comment
Contributor
There was a problem hiding this comment.
Approved after independent static review of the implementation and the two follow-up fixes. The fixes preserve existing working-root storage and restore share-mode private-parent validation while retaining guest-root permissions and existing platform behavior. No blocking regressions identified in the reviewed changes.
This was referenced Nov 14, 2026
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.
Closes #159.
Adds
WithRootFSShare(tag): instead of cloning the cached rootfs on every start,Runboots from an empty root directory in the data dir (hooks, guest VM config and.krun_config.jsonland there) and shares the cache entry read-only over virtio-fs undertag. The guest init assembles its root, e.g. as an overlay. The cached image's OCI config still drives the init config.FromCache); errors otherwise.WithRootFSPath, and whentagcollides with aWithVirtioFSmount.VM.Removekeeps the cache entry, as before.Testing
TestRun_RootFSShare_SharesCachedRootfsReadOnly: hooks see an empty root with the OCI config, nothing is written into the cache entry, the backend gets the read-only mount of the cache path.TestRun_RootFSShare_Validation: pre-built rootfs path and tag collision are rejected before the backend starts.go test ./...,golangci-lint run ./....microvm.Run3.8–4.2 s → 7 ms,jailoc restart~6 s → 1.0–1.6 s.