Struct fixture::vm::Config

source ·
pub struct Config {
    pub(crate) extra_args: Vec<String>,
    pub(crate) o_direct: bool,
    pub(crate) log_level: Level,
    pub(crate) log_file: Option<String>,
    pub(crate) wrapper_cmd: Option<String>,
    pub(crate) kernel_url: Url,
    pub(crate) initrd_url: Option<Url>,
    pub(crate) rootfs_url: Option<Url>,
    pub(crate) rootfs_rw: bool,
    pub(crate) rootfs_compressed: bool,
    pub(crate) console_hardware: String,
}
Expand description

Configuration to start TestVm.

Fields§

§extra_args: Vec<String>

Extra arguments for the run subcommand.

§o_direct: bool

Use O_DIRECT for the rootfs.

§log_level: Level

Log level of TestVm

§log_file: Option<String>

File to save crosvm log to

§wrapper_cmd: Option<String>

Wrapper command line for executing TestVM

§kernel_url: Url

Url to kernel image

§initrd_url: Option<Url>

Url to initrd image

§rootfs_url: Option<Url>

Url to rootfs image

§rootfs_rw: bool

If rootfs image is writable

§rootfs_compressed: bool

If rootfs image is zstd compressed

§console_hardware: String

Console hardware type

Implementations§

source§

impl Config

source

pub fn new() -> Self

Creates a new run command with extra_args.

source

pub fn extra_args(self, args: Vec<String>) -> Self

Uses extra arguments for crosvm run.

source

pub fn o_direct(self) -> Self

Uses O_DIRECT for the rootfs.

source

pub fn disable_sandbox(self) -> Self

Uses disable-sandbox argument for crosvm run.

source

pub fn from_env() -> Self

source

pub fn with_kernel(self, url: &str) -> Self

source

pub fn with_initrd(self, url: &str) -> Self

source

pub fn with_rootfs(self, url: &str) -> Self

source

pub fn rootfs_is_rw(self) -> Self

source

pub fn rootfs_is_compressed(self) -> Self

source

pub fn with_stdout_hardware(self, hw_type: &str) -> Self

source

pub fn with_vhost_user(self, device_type: &str, socket_path: &Path) -> Self

source

pub fn with_vhost_user_fs(self, socket_path: &Path, tag: &str) -> Self

Trait Implementations§

source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.