Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultIdentityName = "machine"
View Source
const MaxSocketPathLength int = 103
View Source
const UserCertsTargetPath = "/etc/containers/certs.d"
Variables ¶
View Source
var ( ErrNoSuchVM = errors.New("VM does not exist") ErrWrongState = errors.New("VM in wrong state to perform action") ErrVMAlreadyExists = errors.New("VM already exists") ErrVMAlreadyRunning = errors.New("VM already running or starting") ErrMultipleActiveVM = errors.New("only one VM can be active at a time") ErrNotImplemented = errors.New("functionality not implemented") )
View Source
var (
DefaultFilePerm os.FileMode = 0644
)
Functions ¶
This section is empty.
Types ¶
type CreateVMOpts ¶
type CreateVMOpts struct {
Name string
Dirs *MachineDirs
ReExec bool
UserModeNetworking bool
}
type ErrIncompatibleMachineConfig ¶
func (*ErrIncompatibleMachineConfig) Error ¶
func (err *ErrIncompatibleMachineConfig) Error() string
type ErrNewDiskSizeTooSmall ¶
type ErrNewDiskSizeTooSmall struct {
OldSize, NewSize strongunits.GiB
}
func (*ErrNewDiskSizeTooSmall) Error ¶
func (err *ErrNewDiskSizeTooSmall) Error() string
type ErrVMDoesNotExist ¶
type ErrVMDoesNotExist struct {
Name string
}
func (*ErrVMDoesNotExist) Error ¶
func (err *ErrVMDoesNotExist) Error() string
type ErrVMRunningCannotDestroyed ¶
type ErrVMRunningCannotDestroyed struct {
Name string
}
func (*ErrVMRunningCannotDestroyed) Error ¶
func (err *ErrVMRunningCannotDestroyed) Error() string
type ImageFormat ¶
type ImageFormat int64
const ( Qcow ImageFormat = iota Vhdx Tar Raw )
func (ImageFormat) Kind ¶
func (imf ImageFormat) Kind() string
func (ImageFormat) KindWithCompression ¶
func (imf ImageFormat) KindWithCompression() string
type InitOptions ¶
type InitOptions struct {
CPUS uint64
DiskSize uint64
IgnitionPath string
Image string
Volumes []string
VolumeDriver string
IsDefault bool
Memory uint64
Name string
TimeZone string
URI url.URL
Username string
ReExec bool
Rootful bool
UID string // uid of the user that called machine
UserModeNetworking *bool // nil = use backend/system default, false = disable, true = enable
USBs []string
}
type MachineDirs ¶
type SetOptions ¶
type SetOptions struct {
CPUs *uint64
DiskSize *strongunits.GiB
Memory *strongunits.MiB
Rootful *bool
UserModeNetworking *bool
USBs *[]string
}
type Status ¶
type Status = string
const Running Status = "running"
Running indicates the qemu vm is running.
const Starting Status = "starting"
Starting indicated the vm is in the process of starting
const Stopped Status = "stopped"
Stopped indicates the vm has stopped.
const Unknown Status = "unknown"
Unknown means the state is not known
type VMFile ¶
type VMFile struct {
// Path is the fully qualified path to a file
Path string
// Symlink is a shortened version of Path by using
// a symlink
Symlink *string `json:"symlink,omitempty"`
}
func NewMachineFile ¶
NewMachineFile is a constructor for VMFile
func (*VMFile) AppendToNewVMFile ¶
AppendToNewVMFile takes a given path and appends it to the existing vmfile path. The new VMFile is returned
func (*VMFile) GetPath ¶
GetPath returns the working path for a machinefile. it returns the symlink unless one does not exist
func (*VMFile) ReadMagicNumber ¶
Read the first n bytes of a given file and return in []bytes
func (*VMFile) ReadPIDFrom ¶
ReadPIDFrom a file and return as int. -1 means the pid file could not be read or had something that could not be converted to an int in it
type VMType ¶
type VMType int64
func (VMType) ImageFormat ¶
func (v VMType) ImageFormat() ImageFormat
Click to show internal directories.
Click to hide internal directories.