syzkaller: Index | Files | Directories

package vm

import ""

Package vm provides an abstract test machine (VM, physical machine, etc) interface for the rest of the system. For convenience test machines are subsequently collectively called VMs. Package wraps vmimpl package interface with some common functionality and higher-level interface.


Package Files



const (
    // The program is allowed to exit after timeout.
    ExitTimeout = ExitCondition(1 << iota)
    // The program is allowed to exit with no errors.
    // The program is allowed to exit with errors.


var (
    Shutdown   = vmimpl.Shutdown
    ErrTimeout = vmimpl.ErrTimeout
var (
    NoOutputTimeout = 5 * time.Minute

func AllowsOvercommit Uses

func AllowsOvercommit(typ string) bool

AllowsOvercommit returns if the instance type allows overcommit of instances (i.e. creation of instances out-of-thin-air). Overcommit is used during image and patch testing in syz-ci when it just asks for more than specified in config instances. Generally virtual machines (qemu, gce) support overcommit, while physical machines (adb, isolated) do not. Strictly speaking, we should never use overcommit and use only what's specified in config, because we override resource limits specified in config (e.g. can OOM). But it works and makes lots of things much simpler.

type BootErrorer Uses

type BootErrorer interface {
    BootError() (string, []byte)

type ExitCondition Uses

type ExitCondition int

type Instance Uses

type Instance struct {
    // contains filtered or unexported fields

func (*Instance) Close Uses

func (inst *Instance) Close()

func (*Instance) Copy Uses

func (inst *Instance) Copy(hostSrc string) (string, error)

func (*Instance) Diagnose Uses

func (inst *Instance) Diagnose() ([]byte, bool)

func (*Instance) Forward Uses

func (inst *Instance) Forward(port int) (string, error)

func (*Instance) MonitorExecution Uses

func (inst *Instance) MonitorExecution(outc <-chan []byte, errc <-chan error,
    reporter report.Reporter, exit ExitCondition) (rep *report.Report)

MonitorExecution monitors execution of a program running inside of a VM. It detects kernel oopses in output, lost connections, hangs, etc. outc/errc is what vm.Instance.Run returns, reporter parses kernel output for oopses. Exit says which exit modes should be considered as errors/OK. Returns a non-symbolized crash report, or nil if no error happens.

func (*Instance) Run Uses

func (inst *Instance) Run(timeout time.Duration, stop <-chan bool, command string) (
    outc <-chan []byte, errc <-chan error, err error)

type Pool Uses

type Pool struct {
    // contains filtered or unexported fields

func Create Uses

func Create(cfg *mgrconfig.Config, debug bool) (*Pool, error)

Create creates a VM pool that can be used to create individual VMs.

func (*Pool) Count Uses

func (pool *Pool) Count() int

func (*Pool) Create Uses

func (pool *Pool) Create(index int) (*Instance, error)


gcePackage gce allows to use Google Compute Engine (GCE) virtual machines as VMs.
gvisorPackage gvisor provides support for gVisor, user-space kernel, testing.
kvmPackage kvm provides VMs based on lkvm (kvmtool) virtualization.
vmimplPackage vmimpl provides an abstract test machine (VM, physical machine, etc) interface for the rest of the system.
vmmPackage vmm provides VMs based on OpenBSD vmm virtualization.

Package vm imports 18 packages (graph) and is imported by 19 packages. Updated 2020-08-07. Refresh now. Tools for package owners.