Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type Alias
- type BIOS
- type Ballooning
- type BandWidth
- type Boot
- type BootMenu
- type BootOrder
- type Channel
- type ChannelSource
- type ChannelTarget
- type Clock
- type Connection
- type Console
- type ConsoleTarget
- type Devices
- type Disk
- type DiskDriver
- type DiskSource
- type DiskSourceHost
- type DiskTarget
- type Domain
- type DomainList
- type DomainManager
- type DomainSpec
- type DomainStatus
- type Entry
- type FilterRef
- type Graphics
- type Interface
- type InterfaceSource
- type InterfaceTarget
- type LibvirtConnection
- type LibvirtDomainManager
- type LifeCycle
- type LinkState
- type Listen
- type Loader
- type MAC
- type Memory
- type MockConnection
- func (_m *MockConnection) Close() (int, error)
- func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
- func (_m *MockConnection) DomainEventLifecycleRegister(dom *libvirt_go.Domain, callback libvirt_go.DomainEventLifecycleCallback) (int, error)
- func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
- func (_m *MockConnection) ListAllDomains(flags libvirt_go.ConnectListAllDomainsFlags) ([]VirDomain, error)
- func (_m *MockConnection) LookupDomainByName(name string) (VirDomain, error)
- type MockDomainManager
- type MockVirDomain
- func (_m *MockVirDomain) Create() error
- func (_m *MockVirDomain) Destroy() error
- func (_m *MockVirDomain) EXPECT() *_MockVirDomainRecorder
- func (_m *MockVirDomain) GetName() (string, error)
- func (_m *MockVirDomain) GetState() (libvirt_go.DomainState, int, error)
- func (_m *MockVirDomain) GetUUIDString() (string, error)
- func (_m *MockVirDomain) GetXMLDesc(flags libvirt_go.DomainXMLFlags) (string, error)
- func (_m *MockVirDomain) Resume() error
- func (_m *MockVirDomain) Undefine() error
- type Model
- type NVRam
- type OS
- type OSType
- type RandomGenerator
- type ReadOnly
- type SMBios
- type Serial
- type SerialTarget
- type StateChangeReason
- type SysInfo
- type Timer
- type Video
- type VideoModel
- type VirDomain
Constants ¶
View Source
const ( NoState LifeCycle = "NoState" Running LifeCycle = "Running" Blocked LifeCycle = "Blocked" Paused LifeCycle = "Paused" Shutdown LifeCycle = "ShuttingDown" Shutoff LifeCycle = "Shutoff" Crashed LifeCycle = "Crashed" PMSuspended LifeCycle = "PMSuspended" // Common reasons ReasonUnknown StateChangeReason = "Unknown" // ShuttingDown reasons ReasonUser StateChangeReason = "User" // Shutoff reasons ReasonShutdown StateChangeReason = "Shutdown" ReasonDestroyed StateChangeReason = "Destroyed" ReasonMigrated StateChangeReason = "Migrated" ReasonCrashed StateChangeReason = "Crashed" ReasonSaved StateChangeReason = "Saved" ReasonFailed StateChangeReason = "Failed" ReasonFromSnapshot StateChangeReason = "FromSnapshot" )
Variables ¶
View Source
var LifeCycleTranslationMap = map[libvirt.DomainState]LifeCycle{ libvirt.DOMAIN_NOSTATE: NoState, libvirt.DOMAIN_RUNNING: Running, libvirt.DOMAIN_BLOCKED: Blocked, libvirt.DOMAIN_PAUSED: Paused, libvirt.DOMAIN_SHUTDOWN: Shutdown, libvirt.DOMAIN_SHUTOFF: Shutoff, libvirt.DOMAIN_CRASHED: Crashed, libvirt.DOMAIN_PMSUSPENDED: PMSuspended, }
View Source
var ShutdownReasonTranslationMap = map[libvirt.DomainShutdownReason]StateChangeReason{ libvirt.DOMAIN_SHUTDOWN_UNKNOWN: ReasonUnknown, libvirt.DOMAIN_SHUTDOWN_USER: ReasonUser, }
View Source
var ShutoffReasonTranslationMap = map[libvirt.DomainShutoffReason]StateChangeReason{ libvirt.DOMAIN_SHUTOFF_UNKNOWN: ReasonUnknown, libvirt.DOMAIN_SHUTOFF_SHUTDOWN: ReasonShutdown, libvirt.DOMAIN_SHUTOFF_DESTROYED: ReasonDestroyed, libvirt.DOMAIN_SHUTOFF_CRASHED: ReasonCrashed, libvirt.DOMAIN_SHUTOFF_MIGRATED: ReasonMigrated, libvirt.DOMAIN_SHUTOFF_SAVED: ReasonSaved, libvirt.DOMAIN_SHUTOFF_FAILED: ReasonFailed, libvirt.DOMAIN_SHUTOFF_FROM_SNAPSHOT: ReasonFromSnapshot, }
Functions ¶
This section is empty.
Types ¶
type BIOS ¶
type BIOS struct { }
TODO <loader readonly='yes' secure='no' type='rom'>/usr/lib/xen/boot/hvmloader</loader>
type Ballooning ¶
type Ballooning struct {
Model string `xml:"model,attr"`
}
type Channel ¶
type Channel struct { Type string `xml:"type,attr"` Source ChannelSource `xml:"source,omitempty"` Target *ChannelTarget `xml:"target,omitempty"` }
type ChannelSource ¶
type ChannelTarget ¶
type Connection ¶
type Connection interface { LookupDomainByName(name string) (VirDomain, error) DomainDefineXML(xml string) (VirDomain, error) Close() (int, error) DomainEventLifecycleRegister(dom *libvirt.Domain, callback libvirt.DomainEventLifecycleCallback) (int, error) ListAllDomains(flags libvirt.ConnectListAllDomainsFlags) ([]VirDomain, error) }
TODO: Should we handle libvirt connection errors transparent or panic?
func NewConnection ¶
func NewConnection(uri string, user string, pass string) (Connection, error)
type Console ¶
type Console struct { Type string `xml:"type,attr"` Target ConsoleTarget `xml:"target"` }
type ConsoleTarget ¶
type Devices ¶
type Devices struct { Emulator string `xml:"emulator"` Interfaces []Interface `xml:"interface"` Channels []Channel `xml:"channel"` Video []Video `xml:"video"` Graphics []Graphics `xml:"graphics"` Ballooning *Ballooning `xml:"memballoon,omitempty"` Disks []Disk `xml:"disk"` Serials []Serial `xml:"serial"` Consoles []Console `xml:"console"` }
type Disk ¶
type Disk struct { Device string `xml:"device,attr"` Snapshot string `xml:"snapshot,attr,omitempty"` Type string `xml:"type,attr"` Source DiskSource `xml:"source"` Target DiskTarget `xml:"target"` Serial string `xml:"serial,omitempty"` Driver *DiskDriver `xml:"driver,omitempty"` ReadOnly *ReadOnly `xml:"readonly,omitempty"` }
type DiskDriver ¶
type DiskSource ¶
type DiskSource struct { File string `xml:"file,attr,omitempty"` StartupPolicy string `xml:"startupPolicy,attr,omitempty"` Protocol string `xml:"protocol,attr,omitempty"` Name string `xml:"name,attr,omitempty"` Host *DiskSourceHost `xml:"host,omitempty"` }
type DiskSourceHost ¶
type DiskTarget ¶
type Domain ¶
type Domain struct { metav1.TypeMeta ObjectMeta kubev1.ObjectMeta Spec DomainSpec Status DomainStatus }
func NewMinimalDomain ¶
func (*Domain) GetObjectKind ¶
func (d *Domain) GetObjectKind() schema.ObjectKind
Required to satisfy Object interface
func (*Domain) GetObjectMeta ¶
Required to satisfy ObjectMetaAccessor interface
type DomainList ¶
func (*DomainList) GetListMeta ¶
func (dl *DomainList) GetListMeta() metav1.List
Required to satisfy ListMetaAccessor interface
func (*DomainList) GetObjectKind ¶
func (dl *DomainList) GetObjectKind() schema.ObjectKind
Required to satisfy Object interface
type DomainManager ¶
func NewLibvirtDomainManager ¶
func NewLibvirtDomainManager(connection Connection, recorder record.EventRecorder) (DomainManager, error)
type DomainSpec ¶
type DomainSpec struct { XMLName xml.Name `xml:"domain"` Name string `xml:"name"` UUID string `xml:"uuid,omitempty"` Memory Memory `xml:"memory"` Type string `xml:"type,attr"` OS OS `xml:"os"` SysInfo *SysInfo `xml:"sysinfo,omitempty"` Devices Devices `xml:"devices"` Clock *Clock `xml:"clock,omitempty"` }
func NewMinimalDomainSpec ¶
func NewMinimalDomainSpec(vmName string) *DomainSpec
type DomainStatus ¶
type DomainStatus struct { Status LifeCycle Reason StateChangeReason }
type Graphics ¶
type Graphics struct { AutoPort string `xml:"autoPort,attr,omitempty"` DefaultMode string `xml:"defaultMode,attr,omitempty"` Listen Listen `xml:"listen,omitempty"` PasswdValidTo string `xml:"passwdValidTo,attr,omitempty"` Port int32 `xml:"port,attr,omitempty"` TLSPort int `xml:"tlsPort,attr,omitempty"` Type string `xml:"type,attr"` }
type Interface ¶
type Interface struct { Address *Address `xml:"address,omitempty"` Type string `xml:"type,attr"` Source InterfaceSource `xml:"source"` Target *InterfaceTarget `xml:"target,omitempty"` Model *Model `xml:"model,omitempty"` MAC *MAC `xml:"mac,omitempty"` BandWidth *BandWidth `xml:"bandwidth,omitempty"` BootOrder *BootOrder `xml:"boot,omitempty"` LinkState *LinkState `xml:"link,omitempty"` FilterRef *FilterRef `xml:"filterref,omitempty"` Alias *Alias `xml:"alias,omitempty"` }
type InterfaceSource ¶
type InterfaceTarget ¶
type InterfaceTarget struct {
Device string `xml:"dev,attr"`
}
type LibvirtConnection ¶
type LibvirtConnection struct { libvirt.Connect // contains filtered or unexported fields }
func (*LibvirtConnection) DomainDefineXML ¶
func (l *LibvirtConnection) DomainDefineXML(xml string) (VirDomain, error)
func (*LibvirtConnection) ListAllDomains ¶
func (l *LibvirtConnection) ListAllDomains(flags libvirt.ConnectListAllDomainsFlags) ([]VirDomain, error)
func (*LibvirtConnection) LookupDomainByName ¶
func (l *LibvirtConnection) LookupDomainByName(name string) (VirDomain, error)
type LibvirtDomainManager ¶
type LibvirtDomainManager struct {
// contains filtered or unexported fields
}
type MockConnection ¶
type MockConnection struct {
// contains filtered or unexported fields
}
Mock of Connection interface
func NewMockConnection ¶
func NewMockConnection(ctrl *gomock.Controller) *MockConnection
func (*MockConnection) Close ¶
func (_m *MockConnection) Close() (int, error)
func (*MockConnection) DomainDefineXML ¶
func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
func (*MockConnection) DomainEventLifecycleRegister ¶
func (_m *MockConnection) DomainEventLifecycleRegister(dom *libvirt_go.Domain, callback libvirt_go.DomainEventLifecycleCallback) (int, error)
func (*MockConnection) EXPECT ¶
func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
func (*MockConnection) ListAllDomains ¶
func (_m *MockConnection) ListAllDomains(flags libvirt_go.ConnectListAllDomainsFlags) ([]VirDomain, error)
func (*MockConnection) LookupDomainByName ¶
func (_m *MockConnection) LookupDomainByName(name string) (VirDomain, error)
type MockDomainManager ¶
type MockDomainManager struct {
// contains filtered or unexported fields
}
Mock of DomainManager interface
func NewMockDomainManager ¶
func NewMockDomainManager(ctrl *gomock.Controller) *MockDomainManager
func (*MockDomainManager) EXPECT ¶
func (_m *MockDomainManager) EXPECT() *_MockDomainManagerRecorder
type MockVirDomain ¶
type MockVirDomain struct {
// contains filtered or unexported fields
}
Mock of VirDomain interface
func NewMockVirDomain ¶
func NewMockVirDomain(ctrl *gomock.Controller) *MockVirDomain
func (*MockVirDomain) Create ¶
func (_m *MockVirDomain) Create() error
func (*MockVirDomain) Destroy ¶
func (_m *MockVirDomain) Destroy() error
func (*MockVirDomain) EXPECT ¶
func (_m *MockVirDomain) EXPECT() *_MockVirDomainRecorder
func (*MockVirDomain) GetName ¶
func (_m *MockVirDomain) GetName() (string, error)
func (*MockVirDomain) GetState ¶
func (_m *MockVirDomain) GetState() (libvirt_go.DomainState, int, error)
func (*MockVirDomain) GetUUIDString ¶
func (_m *MockVirDomain) GetUUIDString() (string, error)
func (*MockVirDomain) GetXMLDesc ¶
func (_m *MockVirDomain) GetXMLDesc(flags libvirt_go.DomainXMLFlags) (string, error)
func (*MockVirDomain) Resume ¶
func (_m *MockVirDomain) Resume() error
func (*MockVirDomain) Undefine ¶
func (_m *MockVirDomain) Undefine() error
type OS ¶
type OS struct { Type OSType `xml:"type"` SMBios *SMBios `xml:"smbios,omitempty"` BootOrder []Boot `xml:"boot"` BootMenu *BootMenu `xml:"bootmenu,omitempty"` BIOS *BIOS `xml:"bios,omitempty"` Kernel string `xml:"kernel,omitempty"` Initrd string `xml:"initrd,omitempty"` KernelArgs string `xml:"cmdline,omitempty"` }
type RandomGenerator ¶
type RandomGenerator struct { }
type Serial ¶
type Serial struct { Type string `xml:"type,attr"` Target SerialTarget `xml:"target"` }
type SerialTarget ¶
type SerialTarget struct {
Port uint `xml:"port,attr"`
}
type StateChangeReason ¶
type StateChangeReason string
type Video ¶
type Video struct {
Model VideoModel `xml:"model"`
}
type VideoModel ¶
Click to show internal directories.
Click to hide internal directories.