Help us shape the future of Go! Take the 2026 Go Developer Survey

machine

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package machine prepares on the host what a backend that boots the kernel of aibox itself needs, whichever VMM it uses: the files of the image, the state disk with its lock, and the vm.Machine of a spec.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStateBusy is a state disk another run of the project has locked.
	ErrStateBusy = errors.New("another aibox runs this project")
	// ErrKernel is a kernel that is not the one this aibox was released
	// with.
	ErrKernel = errors.New("the kernel is not the one of this release")
)

Functions

func Image

func Image(dir string) (kernel, rootfs string, err error)

Image returns the kernel and the root disk in the folder.

func LockState

func LockState(path string) (*os.File, error)

LockState opens the state disk for writing and locks it. The lock stays with the descriptor, so a second run of the project fails here instead of writing to the same file system, for as long as the descriptor or a copy of it, such as the one a VMM inherits, is open.

func Prepare

func Prepare(spec backend.Spec) (vm.Machine, error)

Prepare creates the state disk once the image is known to be complete, and turns the spec into the machine to boot. Owner and the ports are left to the backend.

func ReadKernel added in v1.5.0

func ReadKernel(m vm.Machine) ([]byte, error)

ReadKernel reads the kernel of the machine and checks it against its digest, if it has one. A backend that can boot what it read should, so that the kernel cannot change between the check and the boot.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL