KernelOpCallback

Type Alias KernelOpCallback 

Source
pub type KernelOpCallback = Arc<dyn Fn(&KernelOpRequestPayload) -> KernelOpReplyPayload + Send + Sync + 'static>;
Expand description

Closure type the bridge invokes for a host-side kernel-memory write or read (Op::WriteKernel{Hot,Cold} / Op::ReadKernel{Hot,Cold}).

The host dispatches the request (a sequence of (KernelTarget, KernelValue) entries, plus mode/direction/tag metadata in crate::vmm::wire::KernelOpRequestPayload) against the resolved guest-memory accessor. Returns crate::vmm::wire::KernelOpReplyPayload mirroring the request id, the success/error status, and (for reads) the read-back bytes per entry.

Test fixtures install a closure that records the request and returns a synthetic reply without touching real guest memory (the in-process bridge surface stays mockable). The in-VM production path goes through the wire layer (crate::vmm::wire::MsgType::KernelOpRequest) and the freeze coordinator / hot-path worker, NOT this callback — the bridge keeps it Option<…> so executor tests can install one while real VM runs leave it unset.

Aliased Type§

pub struct KernelOpCallback { /* private fields */ }