Documentation ¶
Index ¶
- Constants
- Variables
- func KVMSubsystem(conmgr containers.ContainerManager, cell *screen.RowCell) error
- func StateToString(state libvirt.DomainState) string
- type Alias
- type Bool
- type ConsoleDevice
- type ConsoleTarget
- type CreateParams
- type Device
- type Devices
- type DiskDevice
- type DiskDeviceType
- type DiskDriver
- type DiskDriverType
- type DiskSource
- type DiskSourceNetworkHost
- type DiskTarget
- type DiskType
- type Domain
- type DomainInfo
- type DomainStats
- type DomainStatsBlock
- type DomainStatsNet
- type DomainStatsVcpu
- type DomainType
- type DomainUUID
- type FListBootConfig
- type FeaturesType
- type Filesystem
- type FilesystemDir
- type GraphicsDevice
- type GraphicsDeviceType
- type IOTune
- type IOTuneParams
- type InterfaceDevice
- type InterfaceDeviceMac
- type InterfaceDeviceModel
- type InterfaceDeviceSource
- type InterfaceDeviceTarget
- type InterfaceDeviceType
- type LastStatistics
- type LibvirtConnection
- type LimitDiskIOParams
- type Listen
- type Machine
- type ManDiskParams
- type ManNicParams
- type Media
- type Memory
- type MigrateParams
- type Mount
- type Network
- type Nic
- type NicParams
- type OS
- type OSType
- type OSTypeType
- type Qemu
- type QemuArg
- type QemuImgInfoResult
- type SerialAlias
- type SerialDevice
- type SerialDeviceType
- type SerialSource
- type SerialTarget
- type Sync
Constants ¶
View Source
const ( DomainTypeKVM = "kvm" OSTypeTypeHVM OSTypeType = "hvm" ArchI686 = "i686" ArchX86_64 = "x86_64" )
View Source
const ( DiskTypeFile DiskType = "file" DiskTypeDir DiskType = "dir" DiskTypeVolume DiskType = "volume" DiskTypeNetwork DiskType = "network" DiskDeviceTypeDisk DiskDeviceType = "disk" DiskDeviceTypeCDROM DiskDeviceType = "cdrom" )
View Source
const ( BaseMACAddress = "00:28:06:82:%02x:%02x" BaseIPAddr = "172.19.%d.%d" //for flist vms VmNamespaceFmt = "vms/%s" VmBaseRoot = "/mnt/vms" )
View Source
const ( OVSTag = "ovs" OVSBackPlane = "backplane" OVSVXBackend = "vxbackend" )
View Source
const (
DefaultBridgeName = "kvm0"
)
Variables ¶
View Source
var ( ReservedSequences = []uint16{0x0, 0x1, 0xffff} BridgeIP = []byte{172, 19, 0, 1} IPRangeStart = fmt.Sprintf("%d.%d.%d.%d", BridgeIP[0], BridgeIP[1], 0, 2) IPRangeEnd = fmt.Sprintf("%d.%d.%d.%d", BridgeIP[0], BridgeIP[1], 255, 254) DefaultBridgeIP = fmt.Sprintf("%d.%d.%d.%d", BridgeIP[0], BridgeIP[1], BridgeIP[2], BridgeIP[3]) DefaultBridgeCIDR = fmt.Sprintf("%s/16", DefaultBridgeIP) )
View Source
var (
SyncTimeout = fmt.Errorf("timeout")
)
Functions ¶
func KVMSubsystem ¶
func KVMSubsystem(conmgr containers.ContainerManager, cell *screen.RowCell) error
func StateToString ¶
func StateToString(state libvirt.DomainState) string
Types ¶
type ConsoleDevice ¶
type ConsoleDevice struct { XMLName xml.Name `xml:"console"` Type SerialDeviceType `xml:"type,attr"` TTY string `xml:"tty,attr"` Source SerialSource `xml:"source"` Target ConsoleTarget `xml:"target"` Alias SerialAlias `xml:"alias"` }
type ConsoleTarget ¶
type CreateParams ¶
type CreateParams struct { NicParams Name string `json:"name"` CPU int `json:"cpu"` Memory int `json:"memory"` FList string `json:"flist"` Mount []Mount `json:"mount"` Media []Media `json:"media"` Config map[string]string `json:"config"` //overrides vm config (from flist) Tags pm.Tags `json:"tags"` }
func (*CreateParams) Valid ¶
func (c *CreateParams) Valid() error
type Devices ¶
type Devices struct { Emulator string `xml:"emulator"` Graphics []GraphicsDevice `xml:"graphics"` Disks []DiskDevice `xml:"disk"` Interfaces []InterfaceDevice `xml:"interface"` Devices []Device `xml:"device"` Filesystems []Filesystem `xml:"filesystem"` }
type DiskDevice ¶
type DiskDevice struct { XMLName xml.Name `xml:"disk"` Type DiskType `xml:"type,attr"` Device DiskDeviceType `xml:"device,attr"` Source DiskSource `xml:"source"` Target DiskTarget `xml:"target"` Driver DiskDriver `xml:"driver"` IOTune IOTune `xml:"iotune,omitempty"` Alias Alias `xml:"alias"` }
type DiskDeviceType ¶
type DiskDeviceType string
type DiskDriver ¶
type DiskDriver struct { Type DiskDriverType `xml:"type,attr,omitempty"` Cache string `xml:"cache,attr,omitempty"` IO string `xml:"io,attr,omitempty"` }
type DiskDriverType ¶
type DiskDriverType string
type DiskSource ¶
type DiskSource struct { // File File string `xml:"file,attr,omitempty"` // Block Dev string `xml:"dev,attr.,omitempty"` // Network Protocol string `xml:"protocol,attr,omitempty"` Host DiskSourceNetworkHost `xml:"host,omitempty"` Name string `xml:"name,attr,omitempty,omitempty"` }
type DiskSourceNetworkHost ¶
type DiskTarget ¶
type Domain ¶
type Domain struct { XMLName xml.Name `xml:"domain"` QemuNS string `xml:"xmlns:qemu,attr"` Type DomainType `xml:"type,attr"` Name string `xml:"name"` UUID string `xml:"uuid"` Memory Memory `xml:"memory"` VCPU int `xml:"vcpu"` OS OS `xml:"os"` Features FeaturesType `xml:"features"` Devices Devices `xml:"devices"` Qemu Qemu `xml:"qemu:commandline"` }
type DomainInfo ¶ added in v1.2.2
type DomainInfo struct { CreateParams Sequence uint16 `json:"seq"` }
type DomainStats ¶
type DomainStats struct { Vcpu []DomainStatsVcpu `json"vcpu"` Net []DomainStatsNet `json"net"` Block []DomainStatsBlock `json"block"` }
type DomainStatsBlock ¶
type DomainStatsNet ¶
type DomainStatsVcpu ¶
type DomainType ¶
type DomainType string
type DomainUUID ¶
type DomainUUID struct {
UUID string `json:"uuid"`
}
type FListBootConfig ¶
type FeaturesType ¶
type Filesystem ¶
type Filesystem struct { Source FilesystemDir `xml:"source"` Target FilesystemDir `xml:"target"` Readonly *Bool `xml:"readonly"` }
type FilesystemDir ¶
type FilesystemDir struct {
Dir string `xml:"dir,attr"`
}
type GraphicsDevice ¶
type GraphicsDeviceType ¶
type GraphicsDeviceType string
const (
GraphicsDeviceTypeVNC GraphicsDeviceType = "vnc"
)
type IOTune ¶
type IOTune struct { TotalBytesSec *uint64 `xml:"total_bytes_sec,omitempty"` ReadBytesSec *uint64 `xml:"read_bytes_sec,omitempty"` WriteBytesSec *uint64 `xml:"write_bytes_sec,omitempty"` TotalIopsSec *uint64 `xml:"total_iops_sec,omitempty"` ReadIopsSec *uint64 `xml:"read_iops_sec,omitempty"` WriteIopsSec *uint64 `xml:"write_iops_sec,omitempty"` TotalBytesSecMax *uint64 `xml:"total_bytes_sec_max,omitempty"` ReadBytesSecMax *uint64 `xml:"read_bytes_sec_max,omitempty"` WriteBytesSecMax *uint64 `xml:"write_bytes_sec_max,omitempty"` TotalIopsSecMax *uint64 `xml:"total_iops_sec_max,omitempty"` ReadIopsSecMax *uint64 `xml:"read_iops_sec_max,omitempty"` WriteIopsSecMax *uint64 `xml:"write_iops_sec_max,omitempty"` TotalBytesSecMaxLength *uint64 `xml:"total_bytes_sec_max_length,omitempty"` ReadBytesSecMaxLength *uint64 `xml:"read_bytes_sec_max_length,omitempty"` WriteBytesSecMaxLength *uint64 `xml:"write_bytes_sec_max_length,omitempty"` TotalIopsSecMaxLength *uint64 `xml:"total_iops_sec_max_length,omitempty"` ReadIopsSecMaxLength *uint64 `xml:"read_iops_sec_max_length,omitempty"` WriteIopsSecMaxLength *uint64 `xml:"write_iops_sec_max_length,omitempty"` SizeIopsSec *uint64 `xml:"size_iops_sec,omitempty"` GroupName *string `xml:"group_name,omitempty"` }
func IOTuneParamsToIOTune ¶
func IOTuneParamsToIOTune(inp IOTuneParams) IOTune
type IOTuneParams ¶
type IOTuneParams struct { TotalBytesSecSet bool `json:"totalbytessecset"` TotalBytesSec uint64 `json:"totalbytessec"` ReadBytesSecSet bool `json:"readbytessecset"` ReadBytesSec uint64 `json:"readbytessec"` WriteBytesSecSet bool `json:"writebytessecset"` WriteBytesSec uint64 `json:"writebytessec"` TotalIopsSecSet bool `json:"totaliopssecset"` TotalIopsSec uint64 `json:"totaliopssec"` ReadIopsSecSet bool `json:"readiopssecset"` ReadIopsSec uint64 `json:"readiopssec"` WriteIopsSecSet bool `json:"writeiopssecset"` WriteIopsSec uint64 `json:"writeiopssec"` TotalBytesSecMaxSet bool `json:"totalbytessecmaxset"` TotalBytesSecMax uint64 `json:"totalbytessecmax"` ReadBytesSecMaxSet bool `json:"readbytessecmaxset"` ReadBytesSecMax uint64 `json:"readbytessecmax"` WriteBytesSecMaxSet bool `json:"writebytessecmaxset"` WriteBytesSecMax uint64 `json:"writebytessecmax"` TotalIopsSecMaxSet bool `json:"totaliopssecmaxset"` TotalIopsSecMax uint64 `json:"totaliopssecmax"` ReadIopsSecMaxSet bool `json:"readiopssecmaxset"` ReadIopsSecMax uint64 `json:"readiopssecmax"` WriteIopsSecMaxSet bool `json:"writeiopssecmaxset"` WriteIopsSecMax uint64 `json:"writeiopssecmax"` TotalBytesSecMaxLengthSet bool `json:"totalbytessecmaxlengthset"` TotalBytesSecMaxLength uint64 `json:"totalbytessecmaxlength"` ReadBytesSecMaxLengthSet bool `json:"readbytessecmaxlengthset"` ReadBytesSecMaxLength uint64 `json:"readbytessecmaxlength"` WriteBytesSecMaxLengthSet bool `json:"writebytessecmaxlengthset"` WriteBytesSecMaxLength uint64 `json:"writebytessecmaxlength"` TotalIopsSecMaxLengthSet bool `json:"totaliopssecmaxlengthset"` TotalIopsSecMaxLength uint64 `json:"totaliopssecmaxlength"` ReadIopsSecMaxLengthSet bool `json:"readiopssecmaxlengthset"` ReadIopsSecMaxLength uint64 `json:"readiopssecmaxlength"` WriteIopsSecMaxLengthSet bool `json:"writeiopssecmaxlengthset"` WriteIopsSecMaxLength uint64 `json:"writeiopssecmaxlength"` SizeIopsSecSet bool `json:"sizeiopssecset"` SizeIopsSec uint64 `json:"sizeiopssec"` GroupNameSet bool `json:"groupnameset"` GroupName string `json:"groupname"` }
type InterfaceDevice ¶
type InterfaceDevice struct { XMLName xml.Name `xml:"interface"` Type InterfaceDeviceType `xml:"type,attr"` Source InterfaceDeviceSource `xml:"source"` Target InterfaceDeviceTarget `xml:"target,omitempty"` Model InterfaceDeviceModel `xml:"model"` Alias Alias `xml:"alias"` Mac *InterfaceDeviceMac `xml:"mac,omitempty"` }
type InterfaceDeviceMac ¶
type InterfaceDeviceMac struct {
Address string `xml:"address,attr"`
}
type InterfaceDeviceModel ¶
type InterfaceDeviceModel struct {
Type string `xml:"type,attr"`
}
type InterfaceDeviceSource ¶
type InterfaceDeviceTarget ¶
type InterfaceDeviceTarget struct {
Dev string `xml:"dev,attr"`
}
type InterfaceDeviceType ¶
type InterfaceDeviceType string
const ( InterfaceDeviceTypeBridge InterfaceDeviceType = "bridge" InterfaceDeviceTypeNetwork InterfaceDeviceType = "network" )
type LastStatistics ¶
type LibvirtConnection ¶
type LibvirtConnection struct {
// contains filtered or unexported fields
}
type LimitDiskIOParams ¶
type LimitDiskIOParams struct { IOTuneParams UUID string `json:"uuid"` Media Media `json:"media"` }
type ManDiskParams ¶
type ManNicParams ¶
type Media ¶
type Media struct { URL string `json:"url"` Type DiskDeviceType `json:"type"` Bus string `json:"bus"` IOTune *IOTuneParams `json:"iotune,omitempty"` }
type MigrateParams ¶
type OSType ¶
type OSType struct { Type OSTypeType `xml:",chardata"` Arch string `xml:"arch,attr"` }
type OSTypeType ¶
type OSTypeType string
type QemuImgInfoResult ¶
type QemuImgInfoResult struct {
Format string `json:"format"`
}
type SerialAlias ¶
type SerialDevice ¶
type SerialDevice struct { XMLName xml.Name `xml:"serial"` Type SerialDeviceType `xml:"type,attr"` Source SerialSource `xml:"source"` Target SerialTarget `xml:"target"` Alias SerialAlias `xml:"alias"` }
type SerialDeviceType ¶
type SerialDeviceType string
const (
SerialDeviceTypePTY SerialDeviceType = "pty"
)
type SerialSource ¶
type SerialTarget ¶
type Sync ¶ added in v1.3.0
type Sync struct {
// contains filtered or unexported fields
}
Sync helper type to process device remove events.
func (*Sync) Expect ¶ added in v1.3.0
Expect notify the sync type that we expect an event for deleting this device
Source Files ¶
Click to show internal directories.
Click to hide internal directories.