Expand description
Guest rootfs management module.
This module handles preparation and management of guest rootfs for MicroVM instances. The rootfs contains the minimal filesystem required to boot the guest agent.
Rootfs staging providers are selected by host capability:
CopyProvider— full recursive copy (works everywhere)OverlayProvider— Linux overlayfs mount (near-instant CoW)- guest-native ext4 on macOS, with case-sensitive APFS for compatibility
A provider finalizes the staging tree into the directory or guest-native block source handed to the VMM.
Structs§
- Attached
Rootfs - A temporarily attached persistent rootfs.
- Copy
Provider - Full recursive copy provider — works on all platforms.
- Ext4
Artifact - Paths and metadata for one complete, validated artifact generation.
- Ext4
Artifact Manifest - Durable metadata committed in the same atomically published directory as the raw filesystem image.
- Ext4
Artifact Options - Determinism inputs and capacity policy for one ext4 artifact.
- Guest
Layout - Guest filesystem layout.
- Overlay
Provider - Overlayfs provider — near-instant CoW mounts (Linux only).
- Resumed
Rootfs - A validated rootfs generation that no longer has a host directory view.
- Rootfs
Artifact Cache Options - Exact identity and resource bounds for an immutable provider artifact.
- Rootfs
Builder - Builder for creating guest rootfs.
- Rootfs
File Info - Minimal file metadata needed to classify rootfs changes.
- Rootfs
Finalize Options - Lifecycle constraints that a provider must honor before handing the rootfs to the VMM.
- Rootfs
OciPrepare Options - Verified OCI inputs for a provider that can publish a bootable artifact without first materializing a host-visible rootfs directory.
- Rootfs
Resume Options - Constraints for reopening an already guest-owned rootfs generation.
Constants§
- DIFF_
BASELINE_ FILE - Filename stored beside each box rootfs.
- EXT4_
ARTIFACT_ SCHEMA - Versioned A3S wrapper contract for a published ext4 artifact directory.
- EXT4_
BUILDER_ ID - Exact writer identity included in cache keys and artifact manifests.
- GUEST_
WORKDIR - Working directory inside the guest VM.
Traits§
- Rootfs
Provider - Abstracts how a rootfs directory is prepared for a box from a cached lower layer.
Functions§
- attach_
persistent_ rootfs - Attach an existing platform-backed persistent rootfs for offline access.
- create_
diff_ baseline_ if_ absent - Persist the first pristine baseline for a box without ever replacing it.
- default_
provider - Auto-detect the best available rootfs provider for a new boot.
- default_
provider_ for_ box - Select the provider for an existing box generation.
- guest_
diff_ baseline_ required - Return whether the next guest generation must capture the first baseline.
- guest_
native_ ext4_ disk_ mib - Return the logical disk capacity owned by a retained guest-native rootfs.
- guest_
native_ ext4_ generation_ exists - Return whether a box has a retained guest-native raw rootfs generation.
- publish_
ext4_ artifact - Build, validate, and atomically publish a raw ext4 filesystem.
- publish_
guest_ diff_ baseline - Validate and publish the baseline captured inside guest-init.
- read_
persisted_ exit_ code - Read the exit code persisted by guest-init.
- resolve_
workload_ exit_ code - Resolve a workload exit code without treating a clean provider shutdown as proof that the guest workload succeeded.
- stage_
box_ terminal_ rootfs_ metadata - Invalidate the last clean-shutdown metadata generation before launching a box, retaining it at the one-shot replay path used by guest-init.
- unmount_
box_ overlay - Unmount a box’s overlayfs
mergedview — best-effort and idempotent. - unmount_
box_ rootfs - Unmount a platform-specific writable rootfs mount.
- walk_
rootfs - Capture a rootfs tree while excluding runtime-owned control files.