vmm

package
v0.0.0-...-5b8b77a Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StoppedGracefully indicates the machine was stopped gracefully.
	StoppedGracefully = StoppedOK(true)
	// StoppedForcefully indicates that the machine did not stop gracefully
	// and the shutdown had to be forced.
	StoppedForcefully = StoppedOK(false)
)

Functions

func FetchMetadataIfExists

func FetchMetadataIfExists(cacheDirectory string) (*metadata.MDRun, bool, error)

FetchMetadataIfExists fetches the metadata from a metadata file in the required directory, if the file exists. Returns a MDRun pointer, if file exists, a boolean indicating if metadata file existed and an error, if metadata lookup went wrong.

func WriteMetadataToFile

func WriteMetadataToFile(md *metadata.MDRun) error

WriteMetadataToFile writes a run metadata to file under the cache directory.

Types

type Provider

type Provider interface {
	// Start starts the VMM.
	Start(context.Context) (StartedMachine, error)

	WithHandlersAdapter(firecracker.HandlersAdapter) Provider
	WithVethIfaceName(string) Provider
}

Provider abstracts the configuration required to start a VMM.

func NewDefaultProvider

func NewDefaultProvider(cniConfig *configs.CNIConfig, jailingFcConfig *configs.JailingFirecrackerConfig, machineConfig *configs.MachineConfig) Provider

NewDefaultProvider creates a default provider.

type StartedMachine

type StartedMachine interface {
	// Cleanup handles cleanup when the machine is stopped from outside of the controlling process.
	Cleanup(chan bool)
	// Decorates metadata with additional properties.
	DecorateMetadata(*metadata.MDRun) error
	// Stop stops the VMM, remote connected client may be nil.
	Stop(context.Context) StoppedOK
	// StopAndWait stops the VMM and waits for the VMM to stop, remote connected client may be nil.
	StopAndWait(context.Context)
	// Wait awaits for the VMM exit.
	Wait(context.Context)
}

StartedMachine abstracts a started Firecracker VMM.

type StoppedOK

type StoppedOK = bool

StoppedOK is the VMM stopped status.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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