pub fn run_shell(
kernel: PathBuf,
numa_nodes: u32,
llcs: u32,
cores: u32,
threads: u32,
include_files: &[(&str, &Path)],
memory_mib: Option<u32>,
dmesg: bool,
exec: Option<&str>,
exec_timeout: Duration,
disk: Option<DiskConfig>,
wprof_args: Option<&str>,
performance_mode: bool,
sched_enable_cmds: &[&str],
sched_disable_cmds: &[&str],
) -> Result<Option<i32>>Expand description
Boot a KVM VM in interactive shell mode.
Builds an initramfs with busybox and optional include files, then
launches a VM with bidirectional stdin/stdout forwarding. The guest
runs a shell via busybox; user-provided files are available at
/include-files/<name>.
kernel: path to the kernel image (bzImage/Image).
numa_nodes, llcs, cores, threads: guest CPU topology.
include_files: (archive_path, host_path) pairs for files to
include in the guest.
memory_mib: explicit guest memory override in MiB; conversion
at VM-launch is value << 20 bytes. When None, memory is
computed from actual initramfs size after build.
disk: optional virtio-blk device backing for /dev/vda. When
Some, the framework calls
vmm::KtstrVm::builder’s .disk(..) so the guest probes a
raw block device sized per disk.capacity_mib.
wprof_args: requires the wprof cargo feature. When the
feature is enabled and Some, replaces WprofConfig::args
with the tokenised value before booting; None keeps the
defaults. Without the feature, this parameter is ignored
(a warning is emitted to stderr if Some).
performance_mode: forwarded to
vmm::KtstrVmBuilder::performance_mode; when true, the
builder pins vCPU threads, applies hugepages, NUMA mbinds, and
promotes vCPU threads to SCHED_FIFO (host-side optimizations).
sched_enable_cmds / sched_disable_cmds: forwarded to
vmm::KtstrVmBuilder::sched_enable_cmds /
vmm::KtstrVmBuilder::sched_disable_cmds. Non-empty when the
shell is reproducing a test whose scheduler is a
test_support::SchedulerSpec::KernelBuiltin variant —
guest init runs the enable cmds before drop-to-busybox and the
disable cmds on shell exit, so the operator gets the same
scheduler-loaded environment the test would see. Empty slices
mean “no scheduler-lifecycle commands.”