pub enum RootfsSource {
Bind {
path: PathBuf,
follow_root_symlinks: bool,
},
Oci(OciRootfsSource),
DiskImage {
path: PathBuf,
format: DiskImageFormat,
fstype: Option<String>,
},
}Expand description
Root filesystem source for a sandbox.
Variants§
Bind
Use a host directory directly as the root filesystem.
Fields
follow_root_symlinks: boolWhether to follow symlinks when resolving the host rootfs path.
Defaults to false: the path is resolved following no symlink in any
component, matching the --mount protection, so a symlink at or under
the rootfs path cannot redirect the mount. Set true to opt out when
the host rootfs path legitimately traverses a symlink.
Oci(OciRootfsSource)
Use an OCI image reference with an EROFS lower and ext4 overlay upper.
DiskImage
Use a disk image file as the root filesystem via virtio-blk.
Implementations§
Source§impl RootfsSource
impl RootfsSource
Sourcepub fn oci(reference: impl Into<String>) -> Self
pub fn oci(reference: impl Into<String>) -> Self
Create an OCI rootfs source from an image reference.
Sourcepub fn oci_reference(&self) -> Option<&str>
pub fn oci_reference(&self) -> Option<&str>
Return the OCI image reference if this is an OCI rootfs.
Sourcepub fn oci_root_disk(&self) -> Option<&RootDisk>
pub fn oci_root_disk(&self) -> Option<&RootDisk>
Return the configured root disk if this is an OCI rootfs.
Sourcepub fn oci_managed_root_disk_size_mib(&self) -> Option<u32>
pub fn oci_managed_root_disk_size_mib(&self) -> Option<u32>
Return the managed root disk size in MiB if this is an OCI rootfs with a managed
(or unset, i.e. default-managed) root disk. Non-managed kinds return None.
Trait Implementations§
Source§impl Clone for RootfsSource
impl Clone for RootfsSource
Source§fn clone(&self) -> RootfsSource
fn clone(&self) -> RootfsSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more