Documentation ¶
Index ¶
- Constants
- Variables
- func AddTapInterface(ifname string, uid int, mq bool) error
- func DelTapInterface(ifname string) error
- func GenHwAddr() (string, error)
- func GetCommandLine(vmi Instance, features *CommandLineFeatures) ([]string, error)
- func IsAlreadyConnectedError(err error) bool
- func IsNotConnectedError(err error) bool
- func IsNotRunningError(err error) bool
- func NewCdromBackend(p string) (backend.DiskBackend, error)
- func NewCloudInitDriveBackend(p string) (backend.DiskBackend, error)
- func NewDiskBackend(p string) (backend.DiskBackend, error)
- func NewFirmwareBackend(p string) (backend.DiskBackend, error)
- func ParseSCSIAddr(s string) (string, string, string)
- func SetInterfaceUp(ifname string) error
- type AlreadyConnectedError
- type CDPool
- type Cdrom
- type CloudInitDrive
- type CommandLineFeatures
- type DevDriver
- type DevDrivers
- type Disk
- type DiskPool
- type ExtKernel
- type FirmwareBackend
- type HostPCI
- type HostPCIPool
- type IncomingConf
- type InputDevice
- type InputPool
- type Instance
- func GetIncomingConf(vmname string) (Instance, error)
- func GetInstanceConf(vmname string) (Instance, error)
- func GetInstanceQemu(vmname string, mon *qmp.Monitor) (Instance, error)
- func GetStartupConf(vmname string) (Instance, error)
- func NewIncomingConf(vmname string) Instance
- func NewInstanceConf(vmname string) Instance
- type InstanceConf
- func (c *InstanceConf) AppendCdrom(d Cdrom) error
- func (c *InstanceConf) AppendDisk(d Disk) error
- func (c *InstanceConf) AppendHostPCI(d HostPCI) error
- func (c *InstanceConf) AppendInputDevice(d InputDevice) error
- func (c *InstanceConf) AppendNetIface(iface NetIface) error
- func (c *InstanceConf) AppendProxy(proxy Proxy) error
- func (c *InstanceConf) AppendVSockDevice(cid uint32) error
- func (c *InstanceConf) ChangeCdromMedia(name, media string) error
- func (c *InstanceConf) InsertCdrom(d Cdrom, idx int) error
- func (c *InstanceConf) InsertDisk(d Disk, idx int) error
- func (c InstanceConf) IsIncoming() bool
- func (c InstanceConf) Pid() int
- func (c *InstanceConf) RemoveCdrom(name string) error
- func (c *InstanceConf) RemoveCloudInitConf() error
- func (c *InstanceConf) RemoveDisk(dpath string) error
- func (c InstanceConf) RemoveDiskBitmap(dpath string) error
- func (c *InstanceConf) RemoveFirmwareConf() error
- func (c *InstanceConf) RemoveHostPCI(hexaddr string) error
- func (c *InstanceConf) RemoveInputDevice(t string) error
- func (c *InstanceConf) RemoveKernelConf() error
- func (c *InstanceConf) RemoveNetIface(ifname string) error
- func (c *InstanceConf) RemoveProxy(fullpath string) error
- func (c *InstanceConf) RemoveVSockDevice() error
- func (c InstanceConf) ResizeQemuBlockdev(_ string) error
- func (c InstanceConf) Save() error
- func (c InstanceConf) SaveStartupConfig() error
- func (c *InstanceConf) SetActualCPUs(n int) error
- func (c *InstanceConf) SetActualMem(s int) error
- func (c *InstanceConf) SetCPUModel(model string) error
- func (c *InstanceConf) SetCPUQuota(quota int) error
- func (c *InstanceConf) SetCPUSockets(n int) error
- func (c *InstanceConf) SetCloudInitDriver(s string) error
- func (c *InstanceConf) SetCloudInitMedia(s string) error
- func (c *InstanceConf) SetDiskReadIops(dpath string, iops int) error
- func (c *InstanceConf) SetDiskWriteIops(dpath string, iops int) error
- func (c *InstanceConf) SetFirmwareFlash(p string) error
- func (c *InstanceConf) SetFirmwareImage(p string) error
- func (c *InstanceConf) SetHostPCIMultifunctionOption(hexaddr string, enabled bool) error
- func (c *InstanceConf) SetHostPCIPrimaryGPUOption(hexaddr string, enabled bool) error
- func (c *InstanceConf) SetKernelCmdline(s string) error
- func (c *InstanceConf) SetKernelImage(s string) error
- func (c *InstanceConf) SetKernelInitrd(s string) error
- func (c *InstanceConf) SetKernelModiso(s string) error
- func (c *InstanceConf) SetMachineType(t string) error
- func (c *InstanceConf) SetNetIfaceDownScript(ifname, scriptPath string) error
- func (c *InstanceConf) SetNetIfaceLinkDown(ifname string) error
- func (c *InstanceConf) SetNetIfaceLinkUp(ifname string) error
- func (c *InstanceConf) SetNetIfaceQueues(ifname string, queues int) error
- func (c *InstanceConf) SetNetIfaceUpScript(ifname, scriptPath string) error
- func (c *InstanceConf) SetTotalCPUs(n int) error
- func (c *InstanceConf) SetTotalMem(s int) error
- func (c InstanceConf) SetVNCPassword(s string) error
- func (c InstanceConf) Status() (InstanceState, error)
- type InstanceProperties
- func (p InstanceProperties) GetActualCPUs() int
- func (p InstanceProperties) GetActualMem() int
- func (p InstanceProperties) GetCPUModel() string
- func (p InstanceProperties) GetCPUQuota() int
- func (p InstanceProperties) GetCPUSockets() int
- func (p InstanceProperties) GetCdromMedia(name string) (string, error)
- func (p InstanceProperties) GetCdroms() CDPool
- func (p InstanceProperties) GetCloudInitDrive() *CloudInitDrive
- func (p InstanceProperties) GetDisks() DiskPool
- func (p InstanceProperties) GetFirmwareFlash() *Disk
- func (p InstanceProperties) GetFirmwareImage() string
- func (p InstanceProperties) GetHostPCIDevices() HostPCIPool
- func (p InstanceProperties) GetInputDevices() InputPool
- func (p InstanceProperties) GetKernelCmdline() string
- func (p InstanceProperties) GetKernelImage() string
- func (p InstanceProperties) GetKernelInitrd() string
- func (p InstanceProperties) GetKernelModiso() string
- func (p InstanceProperties) GetMachineType() *QemuMachine
- func (p InstanceProperties) GetNetIfaces() NetifPool
- func (p InstanceProperties) GetProxyServers() ProxyPool
- func (p InstanceProperties) GetQemuVersion() QemuVersion
- func (p InstanceProperties) GetTotalCPUs() int
- func (p InstanceProperties) GetTotalMem() int
- func (p InstanceProperties) GetVSockDevice() *VirtioVSock
- func (p InstanceProperties) Name() string
- func (p InstanceProperties) Uid() int
- type InstanceQemu
- func (r *InstanceQemu) AppendCdrom(_ Cdrom) error
- func (r *InstanceQemu) AppendDisk(_ Disk) error
- func (r *InstanceQemu) AppendHostPCI(_ HostPCI) error
- func (r *InstanceQemu) AppendInputDevice(_ InputDevice) error
- func (r *InstanceQemu) AppendNetIface(_ NetIface) error
- func (r *InstanceQemu) AppendProxy(proxy Proxy) error
- func (r *InstanceQemu) AppendVSockDevice(cid uint32) error
- func (r *InstanceQemu) ChangeCdromMedia(name, media string) error
- func (r InstanceQemu) GetQemuVersion() QemuVersion
- func (r *InstanceQemu) InsertCdrom(_ Cdrom, _ int) error
- func (r *InstanceQemu) InsertDisk(_ Disk, _ int) error
- func (r InstanceQemu) IsIncoming() bool
- func (r InstanceQemu) Pid() int
- func (r *InstanceQemu) RemoveCdrom(_ string) error
- func (r *InstanceQemu) RemoveCloudInitConf() error
- func (r *InstanceQemu) RemoveDisk(_ string) error
- func (r *InstanceQemu) RemoveDiskBitmap(dpath string) error
- func (r *InstanceQemu) RemoveFirmwareConf() error
- func (r *InstanceQemu) RemoveHostPCI(_ string) error
- func (r *InstanceQemu) RemoveInputDevice(_ string) error
- func (r *InstanceQemu) RemoveKernelConf() error
- func (r *InstanceQemu) RemoveNetIface(_ string) error
- func (r *InstanceQemu) RemoveProxy(fullpath string) error
- func (r *InstanceQemu) RemoveVSockDevice() error
- func (r InstanceQemu) ResizeQemuBlockdev(dpath string) error
- func (r InstanceQemu) Save() error
- func (r *InstanceQemu) SetActualCPUs(n int) error
- func (r *InstanceQemu) SetActualMem(s int) error
- func (r *InstanceQemu) SetCPUModel(model string) error
- func (r *InstanceQemu) SetCPUQuota(quota int) error
- func (r *InstanceQemu) SetCPUSockets(n int) error
- func (r *InstanceQemu) SetCloudInitDriver(s string) error
- func (r *InstanceQemu) SetCloudInitMedia(media string) error
- func (r *InstanceQemu) SetDiskReadIops(dpath string, iops int) error
- func (r *InstanceQemu) SetDiskWriteIops(dpath string, iops int) error
- func (r InstanceQemu) SetFirmwareFlash(_ string) error
- func (r InstanceQemu) SetFirmwareImage(_ string) error
- func (r *InstanceQemu) SetHostPCIMultifunctionOption(_ string, _ bool) error
- func (r *InstanceQemu) SetHostPCIPrimaryGPUOption(_ string, _ bool) error
- func (r *InstanceQemu) SetKernelCmdline(s string) error
- func (r *InstanceQemu) SetKernelImage(s string) error
- func (r *InstanceQemu) SetKernelInitrd(s string) error
- func (r *InstanceQemu) SetKernelModiso(s string) error
- func (r InstanceQemu) SetMachineType(_ string) error
- func (r *InstanceQemu) SetNetIfaceDownScript(_, _ string) error
- func (r *InstanceQemu) SetNetIfaceLinkDown(ifname string) error
- func (r *InstanceQemu) SetNetIfaceLinkUp(ifname string) error
- func (r *InstanceQemu) SetNetIfaceQueues(_ string, _ int) error
- func (r *InstanceQemu) SetNetIfaceUpScript(_, _ string) error
- func (r *InstanceQemu) SetTotalCPUs(n int) error
- func (r *InstanceQemu) SetTotalMem(_ int) error
- func (r InstanceQemu) SetVNCPassword(s string) error
- func (r InstanceQemu) Status() (InstanceState, error)
- type InstanceQemu_i440fx
- func (r *InstanceQemu_i440fx) AppendCdrom(d Cdrom) error
- func (r *InstanceQemu_i440fx) AppendDisk(d Disk) error
- func (r *InstanceQemu_i440fx) AppendNetIface(iface NetIface) error
- func (r *InstanceQemu_i440fx) RemoveCdrom(name string) error
- func (r *InstanceQemu_i440fx) RemoveDisk(dpath string) error
- func (r *InstanceQemu_i440fx) RemoveNetIface(ifname string) error
- type InstanceState
- type KvmrunVersion
- type Machine
- type Memory
- type NetIface
- type NetifPool
- type NotConnectedError
- type NotFoundError
- type NotRunningError
- type Processor
- type Proxy
- type ProxyPool
- type QemuChipset
- type QemuFirmware
- type QemuMachine
- type QemuVersion
- type SCSIBusInfo
- type StartupConf
- type VirtioVSock
Constants ¶
const ( FIRST_INCOMING_PORT = 30000 FIRST_WS_PORT = 10700 FIRST_NBD_PORT = 60000 CONFDIR = "/etc/kvmrun" VMNETINIT = "/usr/lib/kvmrun/netinit" QMPMONDIR = "/var/run/kvm-monitor" CHROOTDIR = "/var/lib/kvmrun/chroot" KERNELSDIR = "/var/lib/kvmrun/kernels" MODULESDIR = "/var/lib/kvmrun/modules" LOGDIR = "/var/log/kvmrun" CGROOTPATH = "kvmrun" )
Variables ¶
var ( ErrNotImplemented = errors.New("not implemented") ErrTimedOut = errors.New("timeout error") )
var CdromDrivers = DevDrivers{ DevDriver{"scsi-cd", true}, DevDriver{"ide-cd", false}, }
var CloudInitDrivers = DevDrivers{ DevDriver{"ide-cd", false}, DevDriver{"floppy", false}, }
var DiskDrivers = DevDrivers{ DevDriver{"virtio-blk-pci", true}, DevDriver{"scsi-hd", true}, DevDriver{"ide-hd", false}, }
var ErrIncorrectContextID = errors.New("incorrect context ID (allowed range is from 3 to 0xffffffff - 1)")
var NetDrivers = DevDrivers{ DevDriver{"virtio-net-pci", true}, DevDriver{"rtl8139", false}, DevDriver{"e1000", false}, }
var Version = KvmrunVersion{1, 4, 2}
Functions ¶
func AddTapInterface ¶
AddTapInterface creates a new tap interface with Name == ifname and owner == uid.
func DelTapInterface ¶
DelTapInterface destroys an existing tap interface with Name == ifname.
func GetCommandLine ¶
func GetCommandLine(vmi Instance, features *CommandLineFeatures) ([]string, error)
func IsAlreadyConnectedError ¶
func IsNotConnectedError ¶
func IsNotRunningError ¶
func NewCdromBackend ¶
func NewCdromBackend(p string) (backend.DiskBackend, error)
func NewCloudInitDriveBackend ¶ added in v1.4.1
func NewCloudInitDriveBackend(p string) (backend.DiskBackend, error)
func NewDiskBackend ¶
func NewDiskBackend(p string) (backend.DiskBackend, error)
func NewFirmwareBackend ¶ added in v1.3.1
func NewFirmwareBackend(p string) (backend.DiskBackend, error)
func SetInterfaceUp ¶
SetInterfaceUp changes the state of a given interface to UP.
Types ¶
type AlreadyConnectedError ¶
func (*AlreadyConnectedError) Error ¶
func (e *AlreadyConnectedError) Error() string
type CDPool ¶
type CDPool []Cdrom
func (CDPool) Exists ¶
Exists returns true if an element with Path == p is present in the list. Otherwise returns false.
type Cdrom ¶
type CloudInitDrive ¶
type CloudInitDrive struct { Media string `json:"path,omitempty"` Driver string `json:"driver,omitempty"` Backend backend.DiskBackend `json:"-"` }
CloudInitDrive contains a path to the cloud-init drive.
func NewCloudInitDrive ¶ added in v1.4.1
func NewCloudInitDrive(media string) (*CloudInitDrive, error)
func (*CloudInitDrive) IsLocal ¶ added in v1.4.1
func (d *CloudInitDrive) IsLocal() bool
func (*CloudInitDrive) QdevID ¶ added in v1.4.1
func (d *CloudInitDrive) QdevID() string
type CommandLineFeatures ¶
type DevDrivers ¶
type DevDrivers []DevDriver
func (DevDrivers) Exists ¶
func (d DevDrivers) Exists(name string) bool
func (DevDrivers) HotPluggable ¶
func (d DevDrivers) HotPluggable(name string) bool
type Disk ¶
type Disk struct { Backend backend.DiskBackend `json:"-"` Path string `json:"path"` Driver string `json:"driver"` IopsRd int `json:"iops_rd"` IopsWr int `json:"iops_wr"` Addr string `json:"addr,omitempty"` Bootindex uint `json:"bootindex,omitempty"` QemuVirtualSize uint64 `json:"-"` HasBitmap bool `json:"-"` }
func (Disk) IsAvailable ¶
type DiskPool ¶
type DiskPool []Disk
func (DiskPool) Exists ¶
Exists returns true if an element with Path == p is present in the list. Otherwise returns false.
type ExtKernel ¶
type ExtKernel struct { Image string `json:"image,omitempty"` Cmdline string `json:"cmdline,omitempty"` Initrd string `json:"initrd,omitempty"` Modiso string `json:"modiso,omitempty"` }
ExtKernel represents the guest kernel configuration structure.
type FirmwareBackend ¶ added in v1.3.1
type FirmwareBackend struct {
backend.DiskBackend
}
func (*FirmwareBackend) BaseName ¶ added in v1.3.1
func (b *FirmwareBackend) BaseName() string
func (*FirmwareBackend) QdevID ¶ added in v1.3.1
func (b *FirmwareBackend) QdevID() string
type HostPCI ¶ added in v1.3.1
type HostPCI struct { Addr string `json:"addr"` // in format [domain:]bus:device.function PrimaryGPU bool `json:"primary_gpu"` Multifunction bool `json:"multifunction"` BackendAddr *pci.Address `json:"-"` }
func NewHostPCI ¶ added in v1.3.1
type HostPCIPool ¶ added in v1.3.1
type HostPCIPool []HostPCI
func (*HostPCIPool) Append ¶ added in v1.3.1
func (p *HostPCIPool) Append(d *HostPCI)
Append appends a new element to the end of the list.
func (HostPCIPool) Exists ¶ added in v1.3.1
func (p HostPCIPool) Exists(hexaddr string) bool
Exists returns true if an element with requested address is present in the list. Otherwise returns false.
func (HostPCIPool) Get ¶ added in v1.3.1
func (p HostPCIPool) Get(hexaddr string) *HostPCI
Get returns a pointer to an element with requested address.
func (*HostPCIPool) Remove ¶ added in v1.3.1
func (p *HostPCIPool) Remove(hexaddr string) error
Remove removes an element with requested address from the list.
func (*HostPCIPool) RemoveN ¶ added in v1.3.1
func (p *HostPCIPool) RemoveN(idx int) error
RemoveN removes an element with Index == idx from the list.
type IncomingConf ¶
type IncomingConf struct {
InstanceConf
}
IncomingConf represents a virtual machine configuration that is used to launch a QEMU incoming instance.
type InputDevice ¶
type InputDevice struct {
Type string `json:"type"`
}
type InputPool ¶
type InputPool []InputDevice
func (*InputPool) Append ¶
func (p *InputPool) Append(d *InputDevice)
Append appends a new element to the end of the list.
func (InputPool) Exists ¶
Exists returns true if an element with Type == t is present in the list. Otherwise returns false.
func (InputPool) Get ¶
func (p InputPool) Get(t string) *InputDevice
Get returns a pointer to an element with Type == t.
type Instance ¶
type Instance interface { Name() string Uid() int Pid() int GetQemuVersion() QemuVersion Status() (InstanceState, error) GetMachineType() *QemuMachine SetMachineType(string) error IsIncoming() bool GetFirmwareImage() string GetFirmwareFlash() *Disk SetFirmwareImage(string) error SetFirmwareFlash(string) error RemoveFirmwareConf() error Save() error GetActualMem() int GetTotalMem() int SetTotalMem(int) error SetActualMem(int) error GetActualCPUs() int GetTotalCPUs() int GetCPUSockets() int GetCPUQuota() int GetCPUModel() string SetActualCPUs(int) error SetTotalCPUs(int) error SetCPUSockets(int) error SetCPUQuota(int) error SetCPUModel(string) error GetHostPCIDevices() HostPCIPool AppendHostPCI(HostPCI) error RemoveHostPCI(string) error SetHostPCIMultifunctionOption(string, bool) error SetHostPCIPrimaryGPUOption(string, bool) error GetInputDevices() InputPool AppendInputDevice(InputDevice) error RemoveInputDevice(string) error GetCdroms() CDPool AppendCdrom(Cdrom) error InsertCdrom(Cdrom, int) error RemoveCdrom(string) error GetCdromMedia(string) (string, error) ChangeCdromMedia(string, string) error GetDisks() DiskPool ResizeQemuBlockdev(string) error AppendDisk(Disk) error InsertDisk(Disk, int) error RemoveDisk(string) error SetDiskReadIops(string, int) error SetDiskWriteIops(string, int) error RemoveDiskBitmap(string) error GetProxyServers() ProxyPool AppendProxy(Proxy) error RemoveProxy(string) error GetNetIfaces() NetifPool AppendNetIface(NetIface) error RemoveNetIface(string) error SetNetIfaceQueues(string, int) error SetNetIfaceUpScript(string, string) error SetNetIfaceDownScript(string, string) error SetNetIfaceLinkUp(string) error SetNetIfaceLinkDown(string) error GetVSockDevice() *VirtioVSock AppendVSockDevice(uint32) error RemoveVSockDevice() error GetCloudInitDrive() *CloudInitDrive SetCloudInitMedia(string) error SetCloudInitDriver(string) error RemoveCloudInitConf() error GetKernelImage() string GetKernelCmdline() string GetKernelInitrd() string GetKernelModiso() string RemoveKernelConf() error SetKernelImage(string) error SetKernelCmdline(string) error SetKernelInitrd(string) error SetKernelModiso(string) error SetVNCPassword(string) error }
func GetIncomingConf ¶
func GetInstanceConf ¶
func GetStartupConf ¶
func NewIncomingConf ¶
func NewInstanceConf ¶
type InstanceConf ¶
type InstanceConf struct { *InstanceProperties // contains filtered or unexported fields }
InstanceConf represents a virtual machine configuration that is used to prepare a QEMU command line.
func (*InstanceConf) AppendCdrom ¶
func (c *InstanceConf) AppendCdrom(d Cdrom) error
func (*InstanceConf) AppendDisk ¶
func (c *InstanceConf) AppendDisk(d Disk) error
func (*InstanceConf) AppendHostPCI ¶ added in v1.3.1
func (c *InstanceConf) AppendHostPCI(d HostPCI) error
func (*InstanceConf) AppendInputDevice ¶
func (c *InstanceConf) AppendInputDevice(d InputDevice) error
func (*InstanceConf) AppendNetIface ¶
func (c *InstanceConf) AppendNetIface(iface NetIface) error
func (*InstanceConf) AppendProxy ¶
func (c *InstanceConf) AppendProxy(proxy Proxy) error
func (*InstanceConf) AppendVSockDevice ¶
func (c *InstanceConf) AppendVSockDevice(cid uint32) error
func (*InstanceConf) ChangeCdromMedia ¶
func (c *InstanceConf) ChangeCdromMedia(name, media string) error
func (*InstanceConf) InsertCdrom ¶
func (c *InstanceConf) InsertCdrom(d Cdrom, idx int) error
func (*InstanceConf) InsertDisk ¶
func (c *InstanceConf) InsertDisk(d Disk, idx int) error
func (InstanceConf) IsIncoming ¶
func (c InstanceConf) IsIncoming() bool
func (InstanceConf) Pid ¶
func (c InstanceConf) Pid() int
func (*InstanceConf) RemoveCdrom ¶
func (c *InstanceConf) RemoveCdrom(name string) error
func (*InstanceConf) RemoveCloudInitConf ¶ added in v1.4.1
func (c *InstanceConf) RemoveCloudInitConf() error
func (*InstanceConf) RemoveDisk ¶
func (c *InstanceConf) RemoveDisk(dpath string) error
func (InstanceConf) RemoveDiskBitmap ¶
func (c InstanceConf) RemoveDiskBitmap(dpath string) error
func (*InstanceConf) RemoveFirmwareConf ¶ added in v1.1.0
func (c *InstanceConf) RemoveFirmwareConf() error
func (*InstanceConf) RemoveHostPCI ¶ added in v1.3.1
func (c *InstanceConf) RemoveHostPCI(hexaddr string) error
func (*InstanceConf) RemoveInputDevice ¶
func (c *InstanceConf) RemoveInputDevice(t string) error
func (*InstanceConf) RemoveKernelConf ¶
func (c *InstanceConf) RemoveKernelConf() error
func (*InstanceConf) RemoveNetIface ¶
func (c *InstanceConf) RemoveNetIface(ifname string) error
func (*InstanceConf) RemoveProxy ¶
func (c *InstanceConf) RemoveProxy(fullpath string) error
func (*InstanceConf) RemoveVSockDevice ¶
func (c *InstanceConf) RemoveVSockDevice() error
func (InstanceConf) ResizeQemuBlockdev ¶
func (c InstanceConf) ResizeQemuBlockdev(_ string) error
func (InstanceConf) Save ¶
func (c InstanceConf) Save() error
func (InstanceConf) SaveStartupConfig ¶
func (c InstanceConf) SaveStartupConfig() error
func (*InstanceConf) SetActualCPUs ¶
func (c *InstanceConf) SetActualCPUs(n int) error
func (*InstanceConf) SetActualMem ¶
func (c *InstanceConf) SetActualMem(s int) error
func (*InstanceConf) SetCPUModel ¶
func (c *InstanceConf) SetCPUModel(model string) error
func (*InstanceConf) SetCPUQuota ¶
func (c *InstanceConf) SetCPUQuota(quota int) error
func (*InstanceConf) SetCPUSockets ¶
func (c *InstanceConf) SetCPUSockets(n int) error
func (*InstanceConf) SetCloudInitDriver ¶ added in v1.4.1
func (c *InstanceConf) SetCloudInitDriver(s string) error
func (*InstanceConf) SetCloudInitMedia ¶ added in v1.4.1
func (c *InstanceConf) SetCloudInitMedia(s string) error
func (*InstanceConf) SetDiskReadIops ¶
func (c *InstanceConf) SetDiskReadIops(dpath string, iops int) error
func (*InstanceConf) SetDiskWriteIops ¶
func (c *InstanceConf) SetDiskWriteIops(dpath string, iops int) error
func (*InstanceConf) SetFirmwareFlash ¶ added in v1.3.1
func (c *InstanceConf) SetFirmwareFlash(p string) error
func (*InstanceConf) SetFirmwareImage ¶ added in v1.1.0
func (c *InstanceConf) SetFirmwareImage(p string) error
func (*InstanceConf) SetHostPCIMultifunctionOption ¶ added in v1.3.1
func (c *InstanceConf) SetHostPCIMultifunctionOption(hexaddr string, enabled bool) error
func (*InstanceConf) SetHostPCIPrimaryGPUOption ¶ added in v1.3.1
func (c *InstanceConf) SetHostPCIPrimaryGPUOption(hexaddr string, enabled bool) error
func (*InstanceConf) SetKernelCmdline ¶
func (c *InstanceConf) SetKernelCmdline(s string) error
func (*InstanceConf) SetKernelImage ¶
func (c *InstanceConf) SetKernelImage(s string) error
func (*InstanceConf) SetKernelInitrd ¶
func (c *InstanceConf) SetKernelInitrd(s string) error
func (*InstanceConf) SetKernelModiso ¶
func (c *InstanceConf) SetKernelModiso(s string) error
func (*InstanceConf) SetMachineType ¶
func (c *InstanceConf) SetMachineType(t string) error
func (*InstanceConf) SetNetIfaceDownScript ¶
func (c *InstanceConf) SetNetIfaceDownScript(ifname, scriptPath string) error
func (*InstanceConf) SetNetIfaceLinkDown ¶
func (c *InstanceConf) SetNetIfaceLinkDown(ifname string) error
func (*InstanceConf) SetNetIfaceLinkUp ¶
func (c *InstanceConf) SetNetIfaceLinkUp(ifname string) error
func (*InstanceConf) SetNetIfaceQueues ¶ added in v1.3.1
func (c *InstanceConf) SetNetIfaceQueues(ifname string, queues int) error
func (*InstanceConf) SetNetIfaceUpScript ¶
func (c *InstanceConf) SetNetIfaceUpScript(ifname, scriptPath string) error
func (*InstanceConf) SetTotalCPUs ¶
func (c *InstanceConf) SetTotalCPUs(n int) error
func (*InstanceConf) SetTotalMem ¶
func (c *InstanceConf) SetTotalMem(s int) error
func (InstanceConf) SetVNCPassword ¶
func (c InstanceConf) SetVNCPassword(s string) error
func (InstanceConf) Status ¶
func (c InstanceConf) Status() (InstanceState, error)
type InstanceProperties ¶
type InstanceProperties struct { MachineType string `json:"machine_type,omitempty"` Firmware QemuFirmware `json:"firmware,omitempty"` Mem Memory `json:"memory"` CPU Processor `json:"cpu"` Inputs InputPool `json:"inputs"` Cdroms CDPool `json:"cdrom"` Disks DiskPool `json:"storage"` Proxy ProxyPool `json:"proxy,omitempty"` NetIfaces NetifPool `json:"network"` VSockDevice *VirtioVSock `json:"vsock_device,omitempty"` CIDrive *CloudInitDrive `json:"cloudinit_drive,omitempty"` Kernel ExtKernel `json:"kernel"` HostPCIDevices HostPCIPool `json:"hostpci"` // contains filtered or unexported fields }
func (InstanceProperties) GetActualCPUs ¶
func (p InstanceProperties) GetActualCPUs() int
func (InstanceProperties) GetActualMem ¶
func (p InstanceProperties) GetActualMem() int
func (InstanceProperties) GetCPUModel ¶
func (p InstanceProperties) GetCPUModel() string
func (InstanceProperties) GetCPUQuota ¶
func (p InstanceProperties) GetCPUQuota() int
func (InstanceProperties) GetCPUSockets ¶
func (p InstanceProperties) GetCPUSockets() int
func (InstanceProperties) GetCdromMedia ¶
func (p InstanceProperties) GetCdromMedia(name string) (string, error)
func (InstanceProperties) GetCdroms ¶
func (p InstanceProperties) GetCdroms() CDPool
func (InstanceProperties) GetCloudInitDrive ¶
func (p InstanceProperties) GetCloudInitDrive() *CloudInitDrive
func (InstanceProperties) GetDisks ¶
func (p InstanceProperties) GetDisks() DiskPool
func (InstanceProperties) GetFirmwareFlash ¶ added in v1.3.1
func (p InstanceProperties) GetFirmwareFlash() *Disk
func (InstanceProperties) GetFirmwareImage ¶ added in v1.1.0
func (p InstanceProperties) GetFirmwareImage() string
func (InstanceProperties) GetHostPCIDevices ¶ added in v1.3.1
func (p InstanceProperties) GetHostPCIDevices() HostPCIPool
func (InstanceProperties) GetInputDevices ¶
func (p InstanceProperties) GetInputDevices() InputPool
func (InstanceProperties) GetKernelCmdline ¶
func (p InstanceProperties) GetKernelCmdline() string
func (InstanceProperties) GetKernelImage ¶
func (p InstanceProperties) GetKernelImage() string
func (InstanceProperties) GetKernelInitrd ¶
func (p InstanceProperties) GetKernelInitrd() string
func (InstanceProperties) GetKernelModiso ¶
func (p InstanceProperties) GetKernelModiso() string
func (InstanceProperties) GetMachineType ¶
func (p InstanceProperties) GetMachineType() *QemuMachine
func (InstanceProperties) GetNetIfaces ¶
func (p InstanceProperties) GetNetIfaces() NetifPool
func (InstanceProperties) GetProxyServers ¶
func (p InstanceProperties) GetProxyServers() ProxyPool
func (InstanceProperties) GetQemuVersion ¶ added in v1.3.1
func (p InstanceProperties) GetQemuVersion() QemuVersion
func (InstanceProperties) GetTotalCPUs ¶
func (p InstanceProperties) GetTotalCPUs() int
func (InstanceProperties) GetTotalMem ¶
func (p InstanceProperties) GetTotalMem() int
func (InstanceProperties) GetVSockDevice ¶
func (p InstanceProperties) GetVSockDevice() *VirtioVSock
func (InstanceProperties) Name ¶
func (p InstanceProperties) Name() string
func (InstanceProperties) Uid ¶
func (p InstanceProperties) Uid() int
type InstanceQemu ¶
type InstanceQemu struct { *InstanceProperties // contains filtered or unexported fields }
InstanceQemu represents a configuration of a running QEMU instance.
func (*InstanceQemu) AppendCdrom ¶
func (r *InstanceQemu) AppendCdrom(_ Cdrom) error
func (*InstanceQemu) AppendDisk ¶
func (r *InstanceQemu) AppendDisk(_ Disk) error
func (*InstanceQemu) AppendHostPCI ¶ added in v1.3.1
func (r *InstanceQemu) AppendHostPCI(_ HostPCI) error
func (*InstanceQemu) AppendInputDevice ¶
func (r *InstanceQemu) AppendInputDevice(_ InputDevice) error
func (*InstanceQemu) AppendNetIface ¶
func (r *InstanceQemu) AppendNetIface(_ NetIface) error
func (*InstanceQemu) AppendProxy ¶
func (r *InstanceQemu) AppendProxy(proxy Proxy) error
func (*InstanceQemu) AppendVSockDevice ¶
func (r *InstanceQemu) AppendVSockDevice(cid uint32) error
func (*InstanceQemu) ChangeCdromMedia ¶
func (r *InstanceQemu) ChangeCdromMedia(name, media string) error
func (InstanceQemu) GetQemuVersion ¶ added in v1.3.1
func (r InstanceQemu) GetQemuVersion() QemuVersion
func (*InstanceQemu) InsertCdrom ¶
func (r *InstanceQemu) InsertCdrom(_ Cdrom, _ int) error
func (*InstanceQemu) InsertDisk ¶
func (r *InstanceQemu) InsertDisk(_ Disk, _ int) error
func (InstanceQemu) IsIncoming ¶
func (r InstanceQemu) IsIncoming() bool
func (InstanceQemu) Pid ¶
func (r InstanceQemu) Pid() int
func (*InstanceQemu) RemoveCdrom ¶
func (r *InstanceQemu) RemoveCdrom(_ string) error
func (*InstanceQemu) RemoveCloudInitConf ¶ added in v1.4.1
func (r *InstanceQemu) RemoveCloudInitConf() error
func (*InstanceQemu) RemoveDisk ¶
func (r *InstanceQemu) RemoveDisk(_ string) error
func (*InstanceQemu) RemoveDiskBitmap ¶
func (r *InstanceQemu) RemoveDiskBitmap(dpath string) error
func (*InstanceQemu) RemoveFirmwareConf ¶ added in v1.1.0
func (r *InstanceQemu) RemoveFirmwareConf() error
func (*InstanceQemu) RemoveHostPCI ¶ added in v1.3.1
func (r *InstanceQemu) RemoveHostPCI(_ string) error
func (*InstanceQemu) RemoveInputDevice ¶
func (r *InstanceQemu) RemoveInputDevice(_ string) error
func (*InstanceQemu) RemoveKernelConf ¶
func (r *InstanceQemu) RemoveKernelConf() error
func (*InstanceQemu) RemoveNetIface ¶
func (r *InstanceQemu) RemoveNetIface(_ string) error
func (*InstanceQemu) RemoveProxy ¶
func (r *InstanceQemu) RemoveProxy(fullpath string) error
func (*InstanceQemu) RemoveVSockDevice ¶
func (r *InstanceQemu) RemoveVSockDevice() error
func (InstanceQemu) ResizeQemuBlockdev ¶
func (r InstanceQemu) ResizeQemuBlockdev(dpath string) error
func (InstanceQemu) Save ¶
func (r InstanceQemu) Save() error
func (*InstanceQemu) SetActualCPUs ¶
func (r *InstanceQemu) SetActualCPUs(n int) error
func (*InstanceQemu) SetActualMem ¶
func (r *InstanceQemu) SetActualMem(s int) error
func (*InstanceQemu) SetCPUModel ¶
func (r *InstanceQemu) SetCPUModel(model string) error
func (*InstanceQemu) SetCPUQuota ¶
func (r *InstanceQemu) SetCPUQuota(quota int) error
func (*InstanceQemu) SetCPUSockets ¶
func (r *InstanceQemu) SetCPUSockets(n int) error
func (*InstanceQemu) SetCloudInitDriver ¶ added in v1.4.1
func (r *InstanceQemu) SetCloudInitDriver(s string) error
func (*InstanceQemu) SetCloudInitMedia ¶ added in v1.4.1
func (r *InstanceQemu) SetCloudInitMedia(media string) error
func (*InstanceQemu) SetDiskReadIops ¶
func (r *InstanceQemu) SetDiskReadIops(dpath string, iops int) error
func (*InstanceQemu) SetDiskWriteIops ¶
func (r *InstanceQemu) SetDiskWriteIops(dpath string, iops int) error
func (InstanceQemu) SetFirmwareFlash ¶ added in v1.3.1
func (r InstanceQemu) SetFirmwareFlash(_ string) error
func (InstanceQemu) SetFirmwareImage ¶ added in v1.1.0
func (r InstanceQemu) SetFirmwareImage(_ string) error
func (*InstanceQemu) SetHostPCIMultifunctionOption ¶ added in v1.3.1
func (r *InstanceQemu) SetHostPCIMultifunctionOption(_ string, _ bool) error
func (*InstanceQemu) SetHostPCIPrimaryGPUOption ¶ added in v1.3.1
func (r *InstanceQemu) SetHostPCIPrimaryGPUOption(_ string, _ bool) error
func (*InstanceQemu) SetKernelCmdline ¶
func (r *InstanceQemu) SetKernelCmdline(s string) error
func (*InstanceQemu) SetKernelImage ¶
func (r *InstanceQemu) SetKernelImage(s string) error
func (*InstanceQemu) SetKernelInitrd ¶
func (r *InstanceQemu) SetKernelInitrd(s string) error
func (*InstanceQemu) SetKernelModiso ¶
func (r *InstanceQemu) SetKernelModiso(s string) error
func (InstanceQemu) SetMachineType ¶
func (r InstanceQemu) SetMachineType(_ string) error
func (*InstanceQemu) SetNetIfaceDownScript ¶
func (r *InstanceQemu) SetNetIfaceDownScript(_, _ string) error
func (*InstanceQemu) SetNetIfaceLinkDown ¶
func (r *InstanceQemu) SetNetIfaceLinkDown(ifname string) error
func (*InstanceQemu) SetNetIfaceLinkUp ¶
func (r *InstanceQemu) SetNetIfaceLinkUp(ifname string) error
func (*InstanceQemu) SetNetIfaceQueues ¶ added in v1.3.1
func (r *InstanceQemu) SetNetIfaceQueues(_ string, _ int) error
func (*InstanceQemu) SetNetIfaceUpScript ¶
func (r *InstanceQemu) SetNetIfaceUpScript(_, _ string) error
func (*InstanceQemu) SetTotalCPUs ¶
func (r *InstanceQemu) SetTotalCPUs(n int) error
func (*InstanceQemu) SetTotalMem ¶
func (r *InstanceQemu) SetTotalMem(_ int) error
func (InstanceQemu) SetVNCPassword ¶
func (r InstanceQemu) SetVNCPassword(s string) error
func (InstanceQemu) Status ¶
func (r InstanceQemu) Status() (InstanceState, error)
type InstanceQemu_i440fx ¶
type InstanceQemu_i440fx struct { *InstanceQemu // contains filtered or unexported fields }
InstanceQemu represents a configuration of a running QEMU instance.
func (*InstanceQemu_i440fx) AppendCdrom ¶
func (r *InstanceQemu_i440fx) AppendCdrom(d Cdrom) error
func (*InstanceQemu_i440fx) AppendDisk ¶
func (r *InstanceQemu_i440fx) AppendDisk(d Disk) error
func (*InstanceQemu_i440fx) AppendNetIface ¶
func (r *InstanceQemu_i440fx) AppendNetIface(iface NetIface) error
func (*InstanceQemu_i440fx) RemoveCdrom ¶
func (r *InstanceQemu_i440fx) RemoveCdrom(name string) error
func (*InstanceQemu_i440fx) RemoveDisk ¶
func (r *InstanceQemu_i440fx) RemoveDisk(dpath string) error
func (*InstanceQemu_i440fx) RemoveNetIface ¶
func (r *InstanceQemu_i440fx) RemoveNetIface(ifname string) error
type InstanceState ¶
type InstanceState uint16
const ( StateNoState InstanceState = iota StateStarting StateRunning StatePaused StateShutdown StateInactive StateCrashed StateIncoming StateMigrating StateMigrated )
type KvmrunVersion ¶
type KvmrunVersion struct { Major int `json:"major"` Minor int `json:"minor"` Micro int `json:"micro"` }
func (KvmrunVersion) String ¶
func (v KvmrunVersion) String() string
func (KvmrunVersion) ToInt ¶
func (v KvmrunVersion) ToInt() int
type Machine ¶
type NetIface ¶
type NetifPool ¶
type NetifPool []NetIface
func (NetifPool) Exists ¶
Exists returns true if an element with Ifname == ifname is present in the list. Otherwise returns false.
type NotConnectedError ¶
func (*NotConnectedError) Error ¶
func (e *NotConnectedError) Error() string
type NotFoundError ¶
type NotFoundError struct {
Name string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type NotRunningError ¶
type NotRunningError struct {
Name string
}
func (*NotRunningError) Error ¶
func (e *NotRunningError) Error() string
type Processor ¶
type Processor struct { Actual int `json:"actual"` Total int `json:"total"` Sockets int `json:"sockets,omitempty"` Quota int `json:"quota,omitempty"` Model string `json:"model,omitempty"` }
Processor represents the guest virtual CPU configuration structure.
type ProxyPool ¶
type ProxyPool []Proxy
func (ProxyPool) Exists ¶
Exists returns true if an element with Path == fullpath is present in the list. Otherwise returns false.
type QemuChipset ¶
type QemuChipset int32
const ( QEMU_CHIPSET_UNKNOWN QemuChipset = iota QEMU_CHIPSET_I440FX QEMU_CHIPSET_Q35 QEMU_CHIPSET_MICROVM )
type QemuFirmware ¶ added in v1.1.0
type QemuMachine ¶
type QemuMachine struct { Chipset QemuChipset `json:"type"` // contains filtered or unexported fields }
func (*QemuMachine) String ¶
func (m *QemuMachine) String() string
type QemuVersion ¶
type QemuVersion int
func (QemuVersion) String ¶
func (v QemuVersion) String() string
type SCSIBusInfo ¶
type StartupConf ¶
type StartupConf struct {
InstanceConf
}
StartupConf represents a virtual machine configuration that was used to launch a QEMU instance.
func (StartupConf) Save ¶
func (c StartupConf) Save() error
type VirtioVSock ¶
Source Files ¶
- backend_proxy.go
- cdrom.go
- channels.go
- cloudinit.go
- cmdline_qemu.go
- cmdline_qemu_i440fx.go
- errors.go
- extkernel.go
- firmware.go
- hostpci.go
- inputs.go
- instance.go
- instance_conf.go
- instance_qemu.go
- instance_qemu_i440fx.go
- kvmrun.go
- machine.go
- memory.go
- network.go
- processor.go
- qemu.go
- states.go
- storage.go
- version.go