CaptureCallback

Type Alias CaptureCallback 

Source
pub type CaptureCallback = Arc<dyn Fn(&str) -> Option<FailureDumpReport> + Send + Sync + 'static>;
Expand description

Closure type the bridge invokes to capture a snapshot.

Returns None when the capture pipeline could not produce a report (rendezvous timed out, capture prerequisites missing, no host-side wiring).

Wire shape (locked: ioeventfd doorbell). The production implementation writes the tag into a small per-call slot inside the SHM region, performs an mmap’d u32 write to the doorbell GPA inside the MMIO gap (KVM dispatches via KVM_IOEVENTFD without a userspace exit), then blocks on a per-request reply completion (an eventfd / mpsc receiver paired with the doorbell registration). The freeze coordinator’s epoll loop wakes on the doorbell eventfd, reads the tag, runs freeze_and_dispatch, and signals the reply completion with the resulting Option<FailureDumpReport>.

On-demand captures are orthogonal to the error-trigger freeze_state machine — the request handler in the coordinator must not transition freeze_state from Idle, and must service requests even when freeze_state == Done. The rendezvous-serialisation invariant is the only constraint: each request waits for all parked == false from the previous capture before issuing.

Aliased Type§

pub struct CaptureCallback { /* private fields */ }