Documentation
¶
Index ¶
- 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 Devices
- type Disk
- type DiskDriver
- type DiskSource
- 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) CloseConnection() (int, error)
- func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
- func (_m *MockConnection) DomainEventRegister(dom libvirt_go.VirDomain, eventId int, ...) int
- func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
- func (_m *MockConnection) ListAllDomains(flags uint32) ([]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() ([]int, error)
- func (_m *MockVirDomain) GetUUIDString() (string, error)
- func (_m *MockVirDomain) GetXMLDesc(flags uint32) (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 SysInfo
- type Timer
- type Video
- type VideoModel
- type VirDomain
Constants ¶
This section is empty.
Variables ¶
View Source
var LifeCycleTranslationMap = map[int]LifeCycle{ libvirt.VIR_DOMAIN_NOSTATE: NoState, libvirt.VIR_DOMAIN_RUNNING: Running, libvirt.VIR_DOMAIN_BLOCKED: Blocked, libvirt.VIR_DOMAIN_PAUSED: Paused, libvirt.VIR_DOMAIN_SHUTDOWN: Shutdown, libvirt.VIR_DOMAIN_SHUTOFF: Shutoff, libvirt.VIR_DOMAIN_CRASHED: Crashed, libvirt.VIR_DOMAIN_PMSUSPENDED: PMSuspended, }
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" json:"model"`
}
type Channel ¶
type Channel struct { Type string `xml:"type,attr" json:"type"` Source ChannelSource `xml:"source,omitempty" json:"source,omitempty"` Target *ChannelTarget `xml:"target,omitempty" json:"target,omitempty"` }
type ChannelSource ¶
type ChannelTarget ¶
type Connection ¶
type Connection interface { LookupDomainByName(name string) (VirDomain, error) DomainDefineXML(xml string) (VirDomain, error) CloseConnection() (int, error) DomainEventRegister(dom libvirt.VirDomain, eventId int, callback *libvirt.DomainEventCallback, opaque func()) int ListAllDomains(flags uint32) ([]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 Devices ¶
type Devices struct { Emulator string `xml:"emulator" json:"emulator"` Interfaces []Interface `xml:"interface" json:"interfaces,omitempty"` Channels []Channel `xml:"channel" json:"channels,omitempty"` Video []Video `xml:"video" json:"video,omitempty"` Graphics []Graphics `xml:"graphics" json:"graphics,omitempty"` Ballooning *Ballooning `xml:"memballoon,omitempty" json:"memballoon,omitempty"` Disks []Disk `xml:"disk" json:"disks,omitempty"` }
type Disk ¶
type Disk struct { Device string `xml:"device,attr" json:"device"` Snapshot string `xml:"snapshot,attr" json:"shapshot"` Type string `xml:"type,attr" json:"type"` DiskSource DiskSource `xml:"source" json:"diskSource"` DiskTarget DiskTarget `xml:"target" json:"diskTarget"` Serial string `xml:"serial,omitempty" json:"serial,omitempty"` Driver *DiskDriver `xml:"driver,omitempty" json:"driver,omitempty"` ReadOnly *ReadOnly `xml:"readonly,omitempty" json:"readOnly,omitempty"` }
type DiskDriver ¶
type DiskDriver struct { Cache string `xml:"cache,attr,omitempty" json:"cache,omitempty"` ErrorPolicy string `xml:"error_policy,attr,omitempty" json:"errorPolicy,omitempty"` IO string `xml:"io,attr,omitempty" json:"io,omitempty"` Name string `xml:"name,attr" json:"name"` Type string `xml:"type,attr" json:"type"` }
type DiskSource ¶
type DiskTarget ¶
type Domain ¶
type Domain struct { unversioned.TypeMeta ObjectMeta api.ObjectMeta Spec DomainSpec Status DomainStatus }
func (*Domain) GetObjectKind ¶
func (d *Domain) GetObjectKind() unversioned.ObjectKind
Required to satisfy Object interface
func (*Domain) GetObjectMeta ¶
Required to satisfy ObjectMetaAccessor interface
type DomainList ¶
type DomainList struct { unversioned.TypeMeta ListMeta unversioned.ListMeta Items []Domain }
func (*DomainList) GetListMeta ¶
func (dl *DomainList) GetListMeta() unversioned.List
Required to satisfy ListMetaAccessor interface
func (*DomainList) GetObjectKind ¶
func (dl *DomainList) GetObjectKind() unversioned.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" json:"-"` Name string `xml:"name" json:"name"` UUID string `xml:"uuid,omitempty" json:"uuid,omitempty"` Memory Memory `xml:"memory" json:"memory"` Type string `xml:"type,attr" json:"type"` OS OS `xml:"os" json:"os"` SysInfo *SysInfo `xml:"sysinfo,omitempty" json:"sysInfo,omitempty"` Devices Devices `xml:"devices" json:"devices"` Clock *Clock `xml:"clock,omitempty" json:"clock,omitempty"` }
func NewMinimalVM ¶
func NewMinimalVM(vmName string) *DomainSpec
type DomainStatus ¶
type DomainStatus struct {
Status LifeCycle
}
type Graphics ¶
type Graphics struct { AutoPort string `xml:"autoPort,attr,omitempty" json:"autoPort,omitempty"` DefaultMode string `xml:"defaultMode,attr,omitempty" json:"defaultMode,omitempty"` Listen Listen `xml:"listen,omitempty" json:"listen,omitempty"` PasswdValidTo string `xml:"passwdValidTo,attr,omitempty" json:"passwdValidTo,omitempty"` Port int `xml:"port,attr,omitempty" json:"port,omitempty"` TLSPort int `xml:"tlsPort,attr,omitempty" json:"tlsPort,omitempty"` Type string `xml:"type,attr" json:"type"` }
type Interface ¶
type Interface struct { Address *Address `xml:"address,omitempty" json:"address,omitempty"` Type string `xml:"type,attr" json:"type"` Source InterfaceSource `xml:"source" json:"source"` Target *InterfaceTarget `xml:"target,omitempty" json:"target,omitempty"` Model *Model `xml:"model,omitempty" json:"model,omitempty"` MAC *MAC `xml:"mac,omitempty" json:"mac,omitempty"` BandWidth *BandWidth `xml:"bandwidth,omitempty" json:"bandwidth,omitempty"` BootOrder *BootOrder `xml:"boot,omitempty" json:"boot,omitempty"` LinkState *LinkState `xml:"link,omitempty" json:"link,omitempty"` FilterRef *FilterRef `xml:"filterref,omitempty" json:"filterRef,omitempty"` Alias *Alias `xml:"alias,omitempty" json:"alias,omitempty"` }
type InterfaceSource ¶
type InterfaceTarget ¶
type InterfaceTarget struct {
Device string `xml:"dev,attr" json:"dev"`
}
type LibvirtConnection ¶
type LibvirtConnection struct {
libvirt.VirConnection
}
func (*LibvirtConnection) DomainDefineXML ¶
func (l *LibvirtConnection) DomainDefineXML(xml string) (VirDomain, error)
func (*LibvirtConnection) ListAllDomains ¶
func (l *LibvirtConnection) ListAllDomains(flags uint32) ([]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) CloseConnection ¶
func (_m *MockConnection) CloseConnection() (int, error)
func (*MockConnection) DomainDefineXML ¶
func (_m *MockConnection) DomainDefineXML(xml string) (VirDomain, error)
func (*MockConnection) DomainEventRegister ¶
func (_m *MockConnection) DomainEventRegister(dom libvirt_go.VirDomain, eventId int, callback *libvirt_go.DomainEventCallback, opaque func()) int
func (*MockConnection) EXPECT ¶
func (_m *MockConnection) EXPECT() *_MockConnectionRecorder
func (*MockConnection) ListAllDomains ¶
func (_m *MockConnection) ListAllDomains(flags uint32) ([]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() ([]int, error)
func (*MockVirDomain) GetUUIDString ¶
func (_m *MockVirDomain) GetUUIDString() (string, error)
func (*MockVirDomain) GetXMLDesc ¶
func (_m *MockVirDomain) GetXMLDesc(flags uint32) (string, error)
func (*MockVirDomain) Resume ¶
func (_m *MockVirDomain) Resume() error
func (*MockVirDomain) Undefine ¶
func (_m *MockVirDomain) Undefine() error
type RandomGenerator ¶
type RandomGenerator struct { }
type Video ¶
type Video struct {
Model VideoModel `xml:"model"`
}
type VideoModel ¶
type VideoModel struct { Type string `xml:"type,attr" json:"type"` Heads uint `xml:"heads,attr,omitempty" json:"heads,omitempty"` Ram uint `xml:"ram,attr,omitempty" json:"ram,omitempty"` VRam uint `xml:"vram,attr,omitempty" json:"vram,omitempty"` VGAMem uint `xml:"vgamem,attr,omitempty" vgamem:"vram,omitempty"` }
Click to show internal directories.
Click to hide internal directories.