firecracker

package
v0.0.0-...-f662469 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirecrackerSocketName = "firecracker.sock"
)

Variables

View Source
var (
	ErrCouldNotSetBootSource        = errors.New("could not set boot source")
	ErrCouldNotSetDrive             = errors.New("could not set drive")
	ErrCouldNotSetMachineConfig     = errors.New("could not set machine config")
	ErrCouldNotSetVSock             = errors.New("could not set vsock")
	ErrCouldNotSetNetworkInterfaces = errors.New("could not set network interfaces")
	ErrCouldNotStartInstance        = errors.New("could not start instance")
	ErrCouldNotStopInstance         = errors.New("could not stop instance")
	ErrCouldNotPauseInstance        = errors.New("could not pause instance")
	ErrCouldNotCreateSnapshot       = errors.New("could not create snapshot")
	ErrCouldNotResumeSnapshot       = errors.New("could not resume snapshot")
	ErrCouldNotFlushSnapshot        = errors.New("could not flush snapshot")
)
View Source
var (
	ErrNoSocketCreated = errors.New("no socket created")
)

Functions

func CreateSnapshot

func CreateSnapshot(
	client *http.Client,

	statePath,
	memoryPath string,
) error

func FlushSnapshot

func FlushSnapshot(
	client *http.Client,

	statePath string,
) error

func ResumeSnapshot

func ResumeSnapshot(
	client *http.Client,

	statePath,
	memoryPath string,
) error

func StartVM

func StartVM(
	client *http.Client,

	initramfsPath string,
	kernelPath string,
	diskPath string,

	cpuCount int,
	memorySize int,
	cpuTemplate string,
	bootArgs string,

	hostInterface string,
	hostMAC string,

	vsockPath string,
	vsockCID int,
) error

func StopVM

func StopVM(
	client *http.Client,
) error

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	firecrackerBin string,
	jailerBin string,

	chrootBaseDir string,

	uid int,
	gid int,

	netns string,
	numaNode int,
	cgroupVersion int,

	enableOutput bool,
	enableInput bool,
) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Open

func (s *Server) Open() (string, error)

func (*Server) Wait

func (s *Server) Wait() error

Jump to

Keyboard shortcuts

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