Trait PetriVmRuntime

Source
pub trait PetriVmRuntime:
    Send
    + Sync
    + 'static {
    type VmInspector: PetriVmInspector;
    type VmFramebufferAccess: PetriVmFramebufferAccess;

Show 14 methods // Required methods fn teardown<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait; fn wait_for_halt<'life0, 'async_trait>( &'life0 mut self, allow_reset: bool, ) -> Pin<Box<dyn Future<Output = Result<PetriHaltReason>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wait_for_agent<'life0, 'async_trait>( &'life0 mut self, set_high_vtl: bool, ) -> Pin<Box<dyn Future<Output = Result<PipetteClient>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn openhcl_diag(&self) -> Option<OpenHclDiagHandler>; fn wait_for_boot_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<FirmwareEvent>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wait_for_enlightened_shutdown_ready<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_enlightened_shutdown<'life0, 'async_trait>( &'life0 mut self, kind: ShutdownKind, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn restart_openhcl<'life0, 'life1, 'async_trait>( &'life0 mut self, new_openhcl: &'life1 ResolvedArtifact, flags: OpenHclServicingFlags, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_openhcl<'life0, 'life1, 'async_trait>( &'life0 mut self, new_openhcl: &'life1 ResolvedArtifact, flags: OpenHclServicingFlags, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn restore_openhcl<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn reset<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn inspector(&self) -> Option<Self::VmInspector> { ... } fn take_framebuffer_access(&mut self) -> Option<Self::VmFramebufferAccess> { ... } fn get_guest_state_file<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

A running VM that tests can interact with.

Required Associated Types§

Source

type VmInspector: PetriVmInspector

Interface for inspecting the VM

Source

type VmFramebufferAccess: PetriVmFramebufferAccess

Interface for accessing the framebuffer

Required Methods§

Source

fn teardown<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,

Cleanly tear down the VM immediately.

Source

fn wait_for_halt<'life0, 'async_trait>( &'life0 mut self, allow_reset: bool, ) -> Pin<Box<dyn Future<Output = Result<PetriHaltReason>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait for the VM to halt, returning the reason for the halt. The VM should automatically restart the VM on reset if allow_reset is true.

Source

fn wait_for_agent<'life0, 'async_trait>( &'life0 mut self, set_high_vtl: bool, ) -> Pin<Box<dyn Future<Output = Result<PipetteClient>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait for a connection from a pipette agent

Source

fn openhcl_diag(&self) -> Option<OpenHclDiagHandler>

Get an OpenHCL diagnostics handler for the VM

Source

fn wait_for_boot_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<FirmwareEvent>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for an event emitted by the firmware about its boot status, and returns that status.

Source

fn wait_for_enlightened_shutdown_ready<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for the Hyper-V shutdown IC to be ready

Source

fn send_enlightened_shutdown<'life0, 'async_trait>( &'life0 mut self, kind: ShutdownKind, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Instruct the guest to shutdown via the Hyper-V shutdown IC.

Source

fn restart_openhcl<'life0, 'life1, 'async_trait>( &'life0 mut self, new_openhcl: &'life1 ResolvedArtifact, flags: OpenHclServicingFlags, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Instruct the OpenHCL to restart the VTL2 paravisor. Will fail if the VM is not running OpenHCL. Will also fail if the VM is not running.

Source

fn save_openhcl<'life0, 'life1, 'async_trait>( &'life0 mut self, new_openhcl: &'life1 ResolvedArtifact, flags: OpenHclServicingFlags, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Instruct the OpenHCL to save the state of the VTL2 paravisor. Will fail if the VM is not running OpenHCL. Will also fail if the VM is not running or if this is called twice in succession without a call to restore_openhcl.

Source

fn restore_openhcl<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Instruct the OpenHCL to restore the state of the VTL2 paravisor. Will fail if the VM is not running OpenHCL. Will also fail if the VM is running or if this is called without prior save.

Source

fn reset<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Issue a hard reset to the VM

Provided Methods§

Source

fn inspector(&self) -> Option<Self::VmInspector>

If the backend supports it, get an inspect interface

Source

fn take_framebuffer_access(&mut self) -> Option<Self::VmFramebufferAccess>

If the backend supports it, take the screenshot interface (subsequent calls may return None).

Source

fn get_guest_state_file<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<PathBuf>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the path to the VM’s guest state file

Implementors§