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 UseNetCompression(typ string) bool
- type BootErrorer
- type ExitCondition
- type InfraErrorer
- type InjectOutput
- type Instance
- func (inst *Instance) Close()
- func (inst *Instance) Copy(hostSrc string) (string, error)
- func (inst *Instance) Forward(port int) (string, error)
- func (inst *Instance) Info() ([]byte, error)
- func (inst *Instance) PprofPort() int
- func (inst *Instance) Run(timeout time.Duration, reporter *report.Reporter, command string, opts ...any) ([]byte, *report.Report, error)
- type OutputSize
- type Pool
- type StopChan
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 UseNetCompression ¶
UseNetCompression says if it's beneficial to use network compression for this VM type. Local VMs (qemu) generally don't benefit from compression, while remote machines may benefit.
Types ¶
type BootErrorer ¶
type ExitCondition ¶
type ExitCondition int
type InfraErrorer ¶
type InjectOutput ¶
type InjectOutput <-chan []byte
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:
- StopChan: stop channel can 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
type OutputSize ¶
type OutputSize int
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. |