PetriVmConfigOpenVmm

Struct PetriVmConfigOpenVmm 

Source
pub struct PetriVmConfigOpenVmm { /* private fields */ }
Expand description

Configuration state for a test VM.

Implementations§

Source§

impl PetriVmConfigOpenVmm

Source

pub fn new( openvmm_path: &ResolvedArtifact, petri_vm_config: PetriVmConfig, resources: &PetriVmResources, ) -> Result<Self>

Create a new VM configuration.

Source§

impl PetriVmConfigOpenVmm

Source

pub fn with_vtl0_alias_map(self) -> Self

Enable the VTL0 alias map.

Source

pub fn with_battery(self) -> Self

Enable the battery for the VM.

Source

pub fn with_igvm_attest_test_config(self, config: IgvmAttestTestConfig) -> Self

Set test config for the GED’s IGVM attest request handler

Source

pub fn with_nic(self) -> Self

Enable a synthnic for the VM.

Uses a mana emulator and the paravisor if a paravisor is present.

Source

pub fn with_custom_vtl2_settings( self, f: impl FnOnce(&mut Vtl2Settings), ) -> Self

Add custom VTL 2 settings.

Source

pub fn with_vtl2_relocation_mode(self, mode: Vtl2BaseAddressType) -> Self

Load with the specified VTL2 relocation mode.

Source

pub fn with_custom_config(self, f: impl FnOnce(&mut Config)) -> Self

This is intended for special one-off use cases. As soon as something is needed in multiple tests we should consider making it a supported pattern.

Source

pub fn with_allow_early_vtl0_access(self, allow: bool) -> Self

Specifies whether VTL2 should be allowed to access VTL0 memory before it sets any VTL protections.

This is needed just for the TMK VMM, and only until it gains support for setting VTL protections.

Source§

impl PetriVmConfigOpenVmm

Source

pub async fn run(self) -> Result<PetriVmOpenVmm>

Run the VM, configuring pipette to automatically start if it is included in the config

Source§

impl PetriVmConfigOpenVmm

Source

pub fn os_flavor(&self) -> OsFlavor

Get the OS that the VM will boot into.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

Source§

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>,

Source§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more