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§
Sourcetype VmInspector: PetriVmInspector
type VmInspector: PetriVmInspector
Interface for inspecting the VM
Sourcetype VmFramebufferAccess: PetriVmFramebufferAccess
type VmFramebufferAccess: PetriVmFramebufferAccess
Interface for accessing the framebuffer
Required Methods§
Sourcefn teardown<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn teardown<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Cleanly tear down the VM immediately.
Sourcefn 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_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.
Sourcefn 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 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
Sourcefn openhcl_diag(&self) -> Option<OpenHclDiagHandler>
fn openhcl_diag(&self) -> Option<OpenHclDiagHandler>
Get an OpenHCL diagnostics handler for the VM
Sourcefn 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_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.
Sourcefn 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 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
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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
.
Sourcefn 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 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.
Provided Methods§
Sourcefn inspector(&self) -> Option<Self::VmInspector>
fn inspector(&self) -> Option<Self::VmInspector>
If the backend supports it, get an inspect interface
Sourcefn take_framebuffer_access(&mut self) -> Option<Self::VmFramebufferAccess>
fn take_framebuffer_access(&mut self) -> Option<Self::VmFramebufferAccess>
If the backend supports it, take the screenshot interface (subsequent calls may return None).