pub struct VerifierVmResult {
pub stats: Vec<ProgStats>,
pub scheduler_log: String,
pub scheduler_stdout: String,
pub scheduler_stderr: String,
pub attach: AttachOutcome,
pub dispatched: bool,
pub scheduler_exited: bool,
pub guest_exit_code: Option<i32>,
pub timed_out: bool,
pub crash_message: Option<String>,
pub dilation: Option<f64>,
}Expand description
Result of collecting verifier output from a VM run.
Fields§
§stats: Vec<ProgStats>Per-program verifier statistics from host-side memory
introspection (bpf_prog_aux->verified_insns).
scheduler_log: StringScheduler log (merged stdout+stderr) from the VM’s teardown
dump_sched_output (the /tmp/sched.log file bracketed by the
SCHED_OUTPUT_START/END markers). Contains libbpf’s verifier
instruction traces when BPF load fails. Present only when the run
reached a dump path (teardown / scheduler-exit / boot-failure);
a watchdog timeout kills the VM before any dump, leaving this
empty — Self::scheduler_stdout / Self::scheduler_stderr
are the live-streamed fallbacks that survive that case.
scheduler_stdout: StringThe scheduler child’s stdout. Normally concatenated directly from the
live MSG_TYPE_SCHED_STDOUT frames shipped per pipe read. When the
guest detects that a live frame was suppressed or failed, a complete
terminal replay replaces that partial live stream only after its
offsets prove every byte arrived. Watchdog-killed and older guests keep
the best-effort live behavior. Raw child stream — no
SCHED_OUTPUT_START/END framing.
scheduler_stderr: StringThe scheduler child’s stderr, using the same live-first,
completion-proven terminal fallback semantics as
Self::scheduler_stdout. Libbpf / log-crate output (including the
BPF verifier log region between the -- BEGIN/END PROG LOAD LOG --
markers) typically lands here.
attach: AttachOutcomeWhether the scheduler positively confirmed attach. Derived from
the guest’s lifecycle frames (AttachOutcome). Attach is
necessary but NOT sufficient for a cell PASS: this must be
AttachOutcome::Attached (the guest emitted the definitive
SchedulerAttached frame) AND Self::dispatched must be true.
Verification alone (non-empty stats) is not enough — a scheduler
whose BPF loads but never reaches sched_ext enabled, or a guest
that vanishes before attach, is a real failure.
dispatched: boolWhether the guest confirmed the injected verifier workload
dispatched — a WorkloadDispatched lifecycle frame, emitted by
ktstr_guest_init Phase 5 when the SpinWait probe recorded a
worker with non-zero iterations after requesting SCHED_EXT
policy. This progress signal is not independent attach proof:
schedulerless SCHED_EXT tasks may run through the kernel fallback.
A cell PASSes only when this is true AND Self::attach is
AttachOutcome::Attached: a scheduler that turns on (sched_ext
enabled) but never dispatches a runnable task is a real, distinct
failure — worse than never attaching — that the attach verdict
alone cannot catch. Derived from the run’s lifecycle frames;
scheduler-agnostic — the probe runs as SCHED_EXT, so the BPF
scheduler dispatches it under any switch mode (full or
SCX_OPS_SWITCH_PARTIAL) and non-zero worker progress proves
dispatch, unlike an scx-specific nr_dispatched counter.
scheduler_exited: boolThe guest scheduler-exit monitor observed the scheduler process
disappear after startup. This is independent of the historical
SchedulerAttached frame: attach-at-t1 followed by exit-at-t2 is a
failure even if SCHED_EXT fallback later lets a probe worker run.
guest_exit_code: Option<i32>Explicit terminal verifier guest exit code from a crc-valid
MSG_TYPE_EXIT frame. The verifier guest emits 0 only after worker
progress, a live scheduler child, and sched_ext enabled are observed
at the same completion edge. None is a failure: a generic VM
shutdown is not terminal verifier evidence.
timed_out: boolThe host watchdog fired (hard-deadline hang) before the guest
exited. NOT orthogonal to Self::attach in the way the message
once implied: a hang can occur EITHER after attach (a teardown
wedge, leaving attach == Attached) OR before it (a scheduler
that died / never reached enabled DURING BPF load and then
wedged without rebooting, leaving attach at
AttachOutcome::Died / AttachOutcome::NotAttached /
AttachOutcome::Unconfirmed). An early kernel panic is the one
case this flag does NOT cover: panic=-1 reboots via an i8042
reset (ExitAction::Shutdown, timed_out == false), caught by
the attach gate as AttachOutcome::Unconfirmed instead. Because
the hang is not attach-implying, Self::cell_verdict words the
timeout message per Self::attach rather than always claiming
“after attach”. A verifier cell FAILs on a hang.
crash_message: Option<String>The guest’s structured crash message (a PANIC:-prefixed line
routed through the host’s extract_panic_message into
crate::vmm::VmResult::crash_message), if any. A self-describing
guest infra fault — most notably the AP-bring-up gap the boot
retry exhausts — that Self::cell_verdict surfaces ABOVE the
attach/dispatch gates, mirroring test_support::eval’s
crash_message priority. None on the common no-crash path.
dilation: Option<f64>Host-side vCPU scheduling dilation for this cell’s VM run —
D = 1 + Σrun_delay/Σon_cpu over the vCPU host threads (see
vmm::result::HostVcpuSchedstat). None on hosts
without CONFIG_SCHEDSTATS or when no vCPU thread was sampled.
Purely observational: surfaced in the per-cell output but NEVER
folded into Self::cell_verdict or the exit code.
Implementations§
Source§impl VerifierVmResult
impl VerifierVmResult
Sourcepub fn cell_verdict(&self) -> Result<(), String>
pub fn cell_verdict(&self) -> Result<(), String>
The verifier cell PASS/FAIL verdict: Ok(()) when the scheduler
verified its BPF, attached (sched_ext enabled), AND dispatched
the injected workload; Err(reason) naming the first failing gate
otherwise. Gate order is timeout, guest crash, observed scheduler
exit, attach, dispatch, then explicit terminal guest exit. Root cause
is reported first: an attach failure is named before the dispatch
gate it necessarily also trips, and a terminal guest exit of 0 is
required after all positive gates.
Auto Trait Implementations§
impl Freeze for VerifierVmResult
impl RefUnwindSafe for VerifierVmResult
impl Send for VerifierVmResult
impl Sync for VerifierVmResult
impl Unpin for VerifierVmResult
impl UnwindSafe for VerifierVmResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more