pub enum RootDisk {
Managed {
size_mib: Option<u32>,
},
Tmpfs {
size_mib: Option<u32>,
},
DiskImage {
path: PathBuf,
format: DiskImageFormat,
fstype: Option<String>,
},
Flat {
size_mib: Option<u32>,
fstype: Option<String>,
clone: FlatClone,
},
}Expand description
Backing for the writable rootfs layer (overlay upper) of an OCI sandbox.
This lives only on OciRootfsSource: the root disk is a property of how an OCI image
becomes a rootfs. Every user surface (CLI --root-disk, SDK builders) is sugar resolving
into this type.
Variants§
Managed
Sparse ext4 created and owned by microsandbox in the sandbox dir. Default. Persistent; grow-only via modify; deleted with the sandbox.
Tmpfs
RAM-backed upper. Ephemeral: the rootfs is pristine on every boot. Pages come from guest memory, so the size must not exceed the sandbox memory.
DiskImage
User-supplied disk image attached writable as the upper. User-owned lifecycle: never created, resized, or deleted by microsandbox.
Fields
format: DiskImageFormatDisk image format. Never probed from file contents.
Flat
A complete OCI root filesystem materialized into one private writable filesystem.
This is microsandbox-owned like RootDisk::Managed, but it replaces the layered
EROFS-plus-OverlayFS topology rather than supplying only its writable upper.
Implementations§
Source§impl RootDisk
impl RootDisk
Sourcepub fn flat(size_mib: u32) -> Self
pub fn flat(size_mib: u32) -> Self
Create a flat root disk with the given final capacity in MiB.
Sourcepub fn size_mib(&self) -> Option<u32>
pub fn size_mib(&self) -> Option<u32>
Return the configured size in MiB, if this kind carries one.
Sourcepub fn kind_str(&self) -> &'static str
pub fn kind_str(&self) -> &'static str
Return the lowercase kind tag used on the wire, in the DB, and in CLI output.
Sourcepub fn is_managed(&self) -> bool
pub fn is_managed(&self) -> bool
Whether this is the managed (default) kind.