vfkit

package
v2.35.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

View Source
const (
	DriverName    = "vf"
	DriverVersion = "0.14.0"

	DefaultMemory  = 8192
	DefaultCPUs    = 4
	DefaultSSHUser = "core"
)
View Source
const (
	// LeasesPath is the path to dhcpd leases
	LeasesPath = "/var/db/dhcpd_leases"
	// VMNetDomain is the domain for vmnet
	VMNetDomain = "/Library/Preferences/SystemConfiguration/com.apple.vmnet"
	// SharedNetAddrKey is the key for the network address
	SharedNetAddrKey = "Shared_Net_Address"
)

Variables

This section is empty.

Functions

func GetIPAddressByMACAddress

func GetIPAddressByMACAddress(mac string) (string, error)

GetIPAddressByMACAddress gets the IP address of a MAC address

func RetryAfter

func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)

RetryAfter retries a number of attempts, after a delay

Types

type DHCPEntry

type DHCPEntry struct {
	Name      string
	IPAddress string
	HWAddress string
	ID        string
	Lease     string
}

DHCPEntry holds a parsed DNS entry

type Driver

type Driver struct {
	*drivers.VMDriver
	VmlinuzPath string
	Cmdline     string
	InitrdPath  string
	VfkitPath   string
	VirtioNet   bool

	VsockPath       string
	DaemonVsockPort uint
	QemuGAVsockPort uint
}

func NewDriver

func NewDriver(hostName, storePath string) *Driver

func (*Driver) Create

func (d *Driver) Create() error

Create a host using the driver's config

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) DriverVersion

func (d *Driver) DriverVersion() string

Get Version information

func (*Driver) GetSharedDirs

func (d *Driver) GetSharedDirs() ([]drivers.SharedDir, error)

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a host forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck allows for pre-create operations to make sure a driver is ready for creation

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a host

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

func (*Driver) UpdateConfigRaw

func (d *Driver) UpdateConfigRaw(rawConfig []byte) error

UpdateConfigRaw allows to change the state (memory, ...) of an already created machine

type MultiError

type MultiError struct {
	Errors []error
}

MultiError holds multiple errors

func (*MultiError) Collect

func (m *MultiError) Collect(err error)

Collect adds the error

func (MultiError) ToError

func (m MultiError) ToError() error

ToError converts all errors into one

type RetriableError

type RetriableError struct {
	Err error
}

RetriableError is an error that can be tried again

func (RetriableError) Error

func (r RetriableError) Error() string

Jump to

Keyboard shortcuts

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