Documentation
¶
Index ¶
- Variables
- func AddHyperListener(listen HyperListener)
- func DomainState2Str(state libvirt.DomainState) string
- type AcpiXML
- type AddressXML
- type ApicXML
- type CPUXML
- type ControllerXML
- type CurMemXML
- type DevicesXML
- type Disk
- type DiskDriverXML
- type DiskSourceXML
- type DiskTargetXML
- type DiskXML
- type Domain
- type DomainXML
- type FeaturesXML
- type GraphicsXML
- type HyperListener
- type HyperVisor
- func (h *HyperVisor) AddListener(listen HyperListener)
- func (h *HyperVisor) Close()
- func (h *HyperVisor) DomainDefineXML(xmlConfig string) (*Domain, error)
- func (h *HyperVisor) FigureCPU() (err error)
- func (h *HyperVisor) GetCPU() (uint, string, uint64)
- func (h *HyperVisor) GetMem() (t uint64, f uint64, c uint64)
- func (h *HyperVisor) GetRootfs() string
- func (h *HyperVisor) ListAllDomains() ([]Domain, error)
- func (h *HyperVisor) LookupDomainByName(id string) (*Domain, error)
- func (h *HyperVisor) LookupDomainByUUIDName(id string) (*Domain, error)
- func (h *HyperVisor) LookupDomainByUUIDString(id string) (*Domain, error)
- func (h *HyperVisor) LoopForever()
- func (h *HyperVisor) Open() error
- func (h *HyperVisor) OpenNotSafe() error
- func (h *HyperVisor) SetName(name string)
- type InputXML
- type Interface
- type InterfaceMacXML
- type InterfaceModelXML
- type InterfaceSourceXML
- type InterfaceTargetXML
- type InterfaceVirtualPortXML
- type InterfaceXML
- type MemXML
- type OSBootMenuXML
- type OSBootXML
- type OSTypeXML
- type OSXML
- type PaeXML
- type SoundXML
- type VCPUXML
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DOMAIN_ALL = libvirt.CONNECT_LIST_DOMAINS_ACTIVE | libvirt.CONNECT_LIST_DOMAINS_INACTIVE DOMAIN_DEVICE_MODIFY_CONFIG = libvirt.DOMAIN_DEVICE_MODIFY_CONFIG DOMAIN_DEVICE_MODIFY_PERSISTENT = libvirt.DOMAIN_DEVICE_MODIFY_LIVE | libvirt.DOMAIN_DEVICE_MODIFY_CONFIG DOMAIN_DESTROY_GRACEFUL = libvirt.DOMAIN_DESTROY_GRACEFUL DOMAIN_SHUTDOWN_ACPI = libvirt.DOMAIN_SHUTDOWN_ACPI_POWER_BTN DOMAIN_CPU_MAXIMUM = libvirt.DOMAIN_VCPU_MAXIMUM | libvirt.DOMAIN_VCPU_CONFIG DOMAIN_CPU_CONFIG = libvirt.DOMAIN_VCPU_CONFIG DOMAIN_MEM_MAXIMUM = libvirt.DOMAIN_MEM_MAXIMUM | libvirt.DOMAIN_MEM_CONFIG DOMAIN_MEM_CONFIG = libvirt.DOMAIN_MEM_CONFIG )
View Source
var ( PCI_DOMAIN = "0x00" PCI_ROOT_BUS = "0x00" PCI_DISK_BUS = "0x01" PCI_INTERFACE_BUS = "0x02" PCI_FUNC = "0x00" DRV_CTL = "0" DRV_ROOT_BUS = "0" DRV_DISK_BUS = "1" DRV_INTERFACE_BUS = "2" )
View Source
var DISK = &Disk{}
View Source
var INTERFACE = &Interface{}
Functions ¶
func AddHyperListener ¶
func AddHyperListener(listen HyperListener)
func DomainState2Str ¶ added in v0.2.23
func DomainState2Str(state libvirt.DomainState) string
Types ¶
type AddressXML ¶
type AddressXML struct {
XMLName xml.Name `xml:"address" json:"-"`
Type string `xml:"type,attr,omitempty" json:"type,omitempty"` // pci and drive.
Domain string `xml:"domain,attr,omitempty" json:"domain,omitempty"`
Bus string `xml:"bus,attr,omitempty" json:"bus,omitempty"`
Slot string `xml:"slot,attr,omitempty" json:"slot,omitempty"`
Function string `xml:"function,attr,omitempty" json:"function,omitempty"`
Target string `xml:"target,attr,omitempty" json:"target,omitempty"`
Unit string `xml:"unit,attr,omitempty" json:"unit,omitempty"`
Controller string `xml:"controller,attr,omitempty" json:"controller,omitempty"`
}
type ControllerXML ¶
type ControllerXML struct {
XMLName xml.Name `xml:"controller" json:"-"`
Type string `xml:"type,attr" json:"type"`
Index string `xml:"index,attr" json:"port"`
Model string `xml:"model,attr" json:"model"` // pci-root, pci-bridge.
Address *AddressXML `xml:"address,omitempty" json:"address,omitempty"`
}
Bus 0: root Bus 1: disk, ide Bus 2: interface Bus 3: reverse
func (*ControllerXML) Decode ¶
func (ctl *ControllerXML) Decode(xmlData string) error
type CurMemXML ¶
type DevicesXML ¶
type DevicesXML struct {
XMLName xml.Name `xml:"devices" json:"-"`
Graphics []GraphicsXML `xml:"graphics" json:"graphics"`
Disks []DiskXML `xml:"disk" json:"disk"`
Interfaces []InterfaceXML `xml:"interface" json:"interface"`
Controllers []ControllerXML `xml:"controller" json:"controller"`
Inputs []InputXML `xml:"input" json:"input"`
Sound SoundXML `xml:"sound" json:"sound"`
}
func (*DevicesXML) Decode ¶
func (devices *DevicesXML) Decode(xmlData string) error
type DiskDriverXML ¶
type DiskSourceXML ¶
type DiskTargetXML ¶
type DiskXML ¶
type DiskXML struct {
XMLName xml.Name `xml:"disk" json:"-"`
Type string `xml:"type,attr" json:"type"`
Device string `xml:"device,attr" json:"device"`
Driver DiskDriverXML `xml:"driver" json:"driver"`
Source DiskSourceXML `xml:"source" json:"source"`
Target DiskTargetXML `xml:"target" json:"target"`
Address *AddressXML `xml:"address,omitempty" json:"address,omitempty"`
}
type Domain ¶
func ListDomains ¶ added in v0.2.23
func LookupDomainByUUIDName ¶
func NewDomainFromVir ¶
type DomainXML ¶
type DomainXML struct {
XMLName xml.Name `xml:"domain" json:"-"`
Id string `xml:"id,attr" json:"id"`
Type string `xml:"type,attr" json:"type"` // kvm
Name string `xml:"name" json:"name"`
UUID string `xml:"uuid" json:"uuid"`
OS OSXML `xml:"os" json:"os"`
CPUXml CPUXML `xml:"cpu" json:"cpu"`
VCPUXml VCPUXML `xml:"vcpu" json:"cpu"`
Memory MemXML `xml:"memory" json:"memory"`
CurMem CurMemXML `xml:"currentMemory" json:"currentMemory"`
Devices DevicesXML `xml:"devices" json:"devices"`
Features FeaturesXML `xml:"features" json:"features"`
}
func NewDomainXMLFromDom ¶
type FeaturesXML ¶
type FeaturesXML struct {
XMLName xml.Name `xml:"features" json:"-"`
Acpi *AcpiXML `xml:"acpi,omitempty" json:"acpi,omitempty"`
Apic *ApicXML `xml:"apic,omitempty" json:"apic,omitempty"`
Pae *PaeXML `xml:"pae,omitempty" json:"pae,omitempty"`
}
func (*FeaturesXML) Decode ¶
func (feat *FeaturesXML) Decode(xmlData string) error
type GraphicsXML ¶
type GraphicsXML struct {
XMLName xml.Name `xml:"graphics" json:"-"`
Type string `xml:"type,attr" json:"type"` // vnc, spice
Port string `xml:"port,attr" json:"port"`
AutoPort string `xml:"autoport,attr,omitempty" json:"autoport"`
Listen string `xml:"listen,attr" json:"listen"`
Password string `xml:"passwd,attr,omitempty" json:"password,omitempty"`
}
func (*GraphicsXML) Decode ¶
func (graphics *GraphicsXML) Decode(xmlData string) error
func (*GraphicsXML) Encode ¶ added in v0.5.90
func (graphics *GraphicsXML) Encode() string
type HyperListener ¶
type HyperVisor ¶
type HyperVisor struct {
Name string
Schema string
Address string
Path string
Conn *libvirt.Connect
Listener []HyperListener
// contains filtered or unexported fields
}
func GetHyper ¶
func GetHyper() (*HyperVisor, error)
func SetHyper ¶
func SetHyper(name string) (*HyperVisor, error)
func (*HyperVisor) AddListener ¶
func (h *HyperVisor) AddListener(listen HyperListener)
func (*HyperVisor) Close ¶
func (h *HyperVisor) Close()
func (*HyperVisor) DomainDefineXML ¶
func (h *HyperVisor) DomainDefineXML(xmlConfig string) (*Domain, error)
func (*HyperVisor) FigureCPU ¶ added in v0.4.83
func (h *HyperVisor) FigureCPU() (err error)
func (*HyperVisor) GetRootfs ¶
func (h *HyperVisor) GetRootfs() string
func (*HyperVisor) ListAllDomains ¶
func (h *HyperVisor) ListAllDomains() ([]Domain, error)
func (*HyperVisor) LookupDomainByName ¶
func (h *HyperVisor) LookupDomainByName(id string) (*Domain, error)
func (*HyperVisor) LookupDomainByUUIDName ¶
func (h *HyperVisor) LookupDomainByUUIDName(id string) (*Domain, error)
func (*HyperVisor) LookupDomainByUUIDString ¶
func (h *HyperVisor) LookupDomainByUUIDString(id string) (*Domain, error)
func (*HyperVisor) LoopForever ¶ added in v0.4.83
func (h *HyperVisor) LoopForever()
func (*HyperVisor) Open ¶
func (h *HyperVisor) Open() error
func (*HyperVisor) OpenNotSafe ¶ added in v0.4.83
func (h *HyperVisor) OpenNotSafe() error
func (*HyperVisor) SetName ¶
func (h *HyperVisor) SetName(name string)
type InterfaceMacXML ¶
type InterfaceModelXML ¶
type InterfaceSourceXML ¶
type InterfaceTargetXML ¶
type InterfaceVirtualPortXML ¶
type InterfaceXML ¶
type InterfaceXML struct {
XMLName xml.Name `xml:"interface" json:"-"`
Type string `xml:"type,attr" json:"type"`
Mac InterfaceMacXML `xml:"mac" json:"mac"`
Source InterfaceSourceXML `xml:"source" json:"source"`
Model InterfaceModelXML `xml:"model" json:"model"`
Target InterfaceTargetXML `xml:"target" json:"tatget"`
VirtualPort *InterfaceVirtualPortXML `xml:"virtualport,omitempty" json:"virtualport,omitempty"`
Address *AddressXML `xml:"address,omitempty" json:"address,omitempty"`
}
func (*InterfaceXML) Decode ¶
func (int *InterfaceXML) Decode(xmlData string) error
func (*InterfaceXML) Encode ¶
func (int *InterfaceXML) Encode() string
type MemXML ¶
type OSBootMenuXML ¶
type OSXML ¶
type OSXML struct {
XMLName xml.Name `xml:"os" json:"-"`
Type OSTypeXML `xml:"type" json:"type"`
Boot []OSBootXML `xml:"boot" json:"boot"` //<bootmenu enable='yes'/>
BootMenu OSBootMenuXML `xml:"bootmenu" json:"bootmenu"`
}
Click to show internal directories.
Click to hide internal directories.