pub enum Filesystem {
Raw,
Btrfs,
}Expand description
Filesystem to format the backing file with.
Raw matches the actual on-disk state: no formatting happens, the
guest sees /dev/vda as a raw unformatted block device.
Non-Raw variants activate the template-cache lifecycle (see
module docs). Selecting one requires the ktstr cache directory
to live on a reflink-capable filesystem (btrfs or xfs) — the
per-test fan-out uses FICLONE to clone the cached template
image and would fail on tmpfs/ext4. The host must also have the
formatter named by Self::mkfs_binary_name on PATH at
template-build time so the template-VM initramfs can pack it.
Variants§
Raw
No filesystem; raw block device. The guest sees /dev/vda as
an unformatted volume of the configured capacity. Default.
Btrfs
btrfs filesystem. Per-test backing is a reflink clone of a
host-cached, guest-formatted btrfs image at the configured
capacity. On cache miss
crate::vmm::disk_template::ensure_template boots a one-shot
template VM that runs mkfs.btrfs /dev/vda inside the guest,
caches the formatted image under the ktstr cache root, and
returns the cached path. On cache hit
crate::vmm::disk_template::clone_to_per_test FICLONE-clones
the cached template into a per-test tempfile under the same
cache filesystem. The cache directory must live on a btrfs/xfs
mount, and mkfs.btrfs must be on the host PATH at
template-build time. See crate::vmm::disk_template.
Trait Implementations§
Source§impl Clone for Filesystem
impl Clone for Filesystem
Source§fn clone(&self) -> Filesystem
fn clone(&self) -> Filesystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Filesystem
impl Debug for Filesystem
Source§impl Default for Filesystem
impl Default for Filesystem
Source§fn default() -> Filesystem
fn default() -> Filesystem
Source§impl<'de> Deserialize<'de> for Filesystem
impl<'de> Deserialize<'de> for Filesystem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for Filesystem
impl Hash for Filesystem
Source§impl PartialEq for Filesystem
impl PartialEq for Filesystem
Source§impl Serialize for Filesystem
impl Serialize for Filesystem
impl Copy for Filesystem
impl Eq for Filesystem
impl StructuralPartialEq for Filesystem
Auto Trait Implementations§
impl Freeze for Filesystem
impl RefUnwindSafe for Filesystem
impl Send for Filesystem
impl Sync for Filesystem
impl Unpin for Filesystem
impl UnwindSafe for Filesystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more