Trait virt::Processor

source ·
pub trait Processor: InspectMut {
    type Error: Error + Send + Sync + 'static;
    type RunVpError: Error + Send + Sync + 'static;
    type StateAccess<'a>: AccessVpState
       where Self: 'a;

    // Required methods
    fn set_debug_state(
        &mut self,
        vtl: Vtl,
        state: Option<&DebugState>,
    ) -> Result<(), Self::Error>;
    async fn run_vp(
        &mut self,
        stop: StopVp<'_>,
        dev: &impl CpuIo,
    ) -> Result<Infallible, VpHaltReason<Self::RunVpError>>;
    fn flush_async_requests(&mut self) -> Result<(), Self::RunVpError>;
    fn access_state(&mut self, vtl: Vtl) -> Self::StateAccess<'_>;

    // Provided method
    fn vtl_inspectable(&self, vtl: Vtl) -> bool { ... }
}

Required Associated Types§

source

type Error: Error + Send + Sync + 'static

source

type RunVpError: Error + Send + Sync + 'static

source

type StateAccess<'a>: AccessVpState where Self: 'a

Required Methods§

source

fn set_debug_state( &mut self, vtl: Vtl, state: Option<&DebugState>, ) -> Result<(), Self::Error>

Sets the debug state: conditions under which the VP should exit for debugging the guest. This including single stepping and hardware breakpoints.

source

async fn run_vp( &mut self, stop: StopVp<'_>, dev: &impl CpuIo, ) -> Result<Infallible, VpHaltReason<Self::RunVpError>>

Runs the VP.

Although this is an async function, it may block synchronously until Partition::request_yield is called for this VP. Then its future must return Poll::Pending at least once.

Returns when an error occurs, the VP halts, or the VP is requested to stop via stop.

source

fn flush_async_requests(&mut self) -> Result<(), Self::RunVpError>

Without running the VP, flushes any asynchronous requests from other processors or objects that might affect this state, so that the object can be saved/restored correctly.

source

fn access_state(&mut self, vtl: Vtl) -> Self::StateAccess<'_>

Provided Methods§

source

fn vtl_inspectable(&self, vtl: Vtl) -> bool

Returns whether the specified VTL can be inspected on this processor.

VTL0 is always inspectable.

Object Safety§

This trait is not object safe.

Implementors§