Documentation ¶
Overview ¶
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.
Index ¶
- Constants
- Variables
- func AllowsOvercommit(typ string) bool
- func ShutdownCtx() context.Context
- type BootErrorer
- type Dispatcher
- type EarlyFinishCb
- type ExitCondition
- type InfraErrorer
- type InjectExecuting
- type Instance
- func (inst *Instance) Close() error
- func (inst *Instance) Copy(hostSrc string) (string, error)
- func (inst *Instance) Forward(port int) (string, error)
- func (inst *Instance) Index() int
- func (inst *Instance) Info() ([]byte, error)
- func (inst *Instance) Run(timeout time.Duration, reporter *report.Reporter, command string, opts ...any) ([]byte, *report.Report, error)
- func (inst *Instance) RunSnapshot(input []byte) (result, output []byte, err error)
- func (inst *Instance) SetupSnapshot(input []byte) error
- type OutputSize
- type Pool
- type StopContext
Constants ¶
const ( // The program is allowed to exit after timeout. ExitTimeout = ExitCondition(1 << iota) // The program is allowed to exit with no errors. ExitNormal // The program is allowed to exit with errors. ExitError )
Variables ¶
var ( Shutdown = vmimpl.Shutdown ErrTimeout = vmimpl.ErrTimeout )
Functions ¶
func AllowsOvercommit ¶
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.
func ShutdownCtx ¶
Types ¶
type BootErrorer ¶
type Dispatcher ¶
type Dispatcher = dispatcher.Pool[*Instance]
func NewDispatcher ¶
func NewDispatcher(pool *Pool, def dispatcher.Runner[*Instance]) *Dispatcher
type EarlyFinishCb ¶
type EarlyFinishCb func()
An early notification that the command has finished / VM crashed.
type ExitCondition ¶
type ExitCondition int
type InfraErrorer ¶
type InjectExecuting ¶
type InjectExecuting <-chan bool
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) Run ¶
func (inst *Instance) Run(timeout time.Duration, reporter *report.Reporter, command string, opts ...any) ( []byte, *report.Report, error)
Run runs cmd inside of the VM (think of ssh cmd) and monitors command execution and the kernel console output. It detects kernel oopses in output, lost connections, hangs, etc. Returns command+kernel output and a non-symbolized crash report (nil if no error happens). Accepted options:
- StopContext: the context to be used to prematurely stop the command
- ExitCondition: says which exit modes should be considered as errors/OK
- OutputSize: how much output to keep/return
func (*Instance) RunSnapshot ¶
RunSnapshot runs one input in snapshotting mode. Input is copied into the VM in an implementation defined way and is interpreted by executor. Result is the result provided by the executor. Output is the kernel console output during execution of the input.
func (*Instance) SetupSnapshot ¶
SetupSnapshot must be called once before calling RunSnapshot. Input is copied into the VM in an implementation defined way and is interpreted by executor.
type OutputSize ¶
type OutputSize int
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
type StopContext ¶
Directories ¶
Path | Synopsis |
---|---|
Package cuttlefish allows to use Cuttlefish Android emulators hosted on Google Compute Engine (GCE) virtual machines as VMs.
|
Package cuttlefish allows to use Cuttlefish Android emulators hosted on Google Compute Engine (GCE) virtual machines as VMs. |
Package gce allows to use Google Compute Engine (GCE) virtual machines as VMs.
|
Package gce allows to use Google Compute Engine (GCE) virtual machines as VMs. |
Package gvisor provides support for gVisor, user-space kernel, testing.
|
Package gvisor provides support for gVisor, user-space kernel, testing. |
Package proxyapp package implements the experimental plugins support.
|
Package proxyapp package implements the experimental plugins support. |
Package vmimpl provides an abstract test machine (VM, physical machine, etc) interface for the rest of the system.
|
Package vmimpl provides an abstract test machine (VM, physical machine, etc) interface for the rest of the system. |
Package vmm provides VMs based on OpenBSD vmm virtualization.
|
Package vmm provides VMs based on OpenBSD vmm virtualization. |