Documentation ¶
Index ¶
- Variables
- func AddHyperListener(listen HyperListener)
- func DomainState2Str(state libvirt.DomainState) string
- type ACPIXML
- type APICXML
- type AddressXML
- type CPUXML
- type ChannelDeviceXML
- type ChannelSourceXML
- type ChannelTargetXML
- 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) SetUrl(name string)
- func (h *HyperVisor) UpTime() int64
- type InputDeviceXML
- type Interface
- type InterfaceDriverXML
- type InterfaceMacXML
- type InterfaceModelXML
- type InterfaceSourceXML
- type InterfaceTargetXML
- type InterfaceVirPortXML
- type InterfaceXML
- type MemXML
- type OSBootMenuXML
- type OSBootXML
- type OSTypeXML
- type OSXML
- type PaeXML
- type SnapshotXML
- type SoundDeviceXML
- type VCPUXML
- type VideoDeviceXML
- type VideoModelXML
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DomainAll = libvirt.CONNECT_LIST_DOMAINS_ACTIVE | libvirt.CONNECT_LIST_DOMAINS_INACTIVE DomainDeviceModifyConfig = libvirt.DOMAIN_DEVICE_MODIFY_CONFIG DomainDeviceModifyPersistent = libvirt.DOMAIN_DEVICE_MODIFY_LIVE | libvirt.DOMAIN_DEVICE_MODIFY_CONFIG DomainDestroyGraceful = libvirt.DOMAIN_DESTROY_GRACEFUL DomainShutdownAcpi = libvirt.DOMAIN_SHUTDOWN_ACPI_POWER_BTN DomainCpuMaximum = libvirt.DOMAIN_VCPU_MAXIMUM | libvirt.DOMAIN_VCPU_CONFIG DomainCpuConfig = libvirt.DOMAIN_VCPU_CONFIG DomainMemMaximum = libvirt.DOMAIN_MEM_MAXIMUM | libvirt.DOMAIN_MEM_CONFIG DomainMemConfig = libvirt.DOMAIN_MEM_CONFIG )
View Source
var ( PciDomain = "0x00" PciDiskBus = "0x01" PciInterfaceBus = "0x02" PciFunc = "0x00" )
View Source
var DISK = &Disk{}
View Source
var INTERFACE = &Interface{}
Functions ¶
func AddHyperListener ¶
func AddHyperListener(listen HyperListener)
func DomainState2Str ¶
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"` // pci and drive. Domain string `xml:"domain,attr,omitempty" json:"domain"` Bus string `xml:"bus,attr,omitempty" json:"bus"` Slot string `xml:"slot,attr,omitempty" json:"slot"` Function string `xml:"function,attr,omitempty" json:"function"` Target string `xml:"target,attr,omitempty" json:"target"` Unit string `xml:"unit,attr,omitempty" json:"unit"` Controller string `xml:"controller,attr,omitempty" json:"controller"` }
type ChannelDeviceXML ¶
type ChannelDeviceXML struct { XMLName xml.Name `xml:"channel" json:"-"` Type string `xml:"type,attr" json:"type"` Source ChannelSourceXML `xml:"source" json:"source"` Target ChannelTargetXML `xml:"target" json:"target"` }
type ChannelSourceXML ¶
type ChannelTargetXML ¶
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,omitempty" json:"model"` // pci-root, pci-bridge. Address *AddressXML `xml:"address,omitempty" json:"address"` }
Bus 0: root Bus 1: disk, ide Bus 2: interface Bus 3: reverse
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 []InputDeviceXML `xml:"input" json:"input"` Sound SoundDeviceXML `xml:"sound" json:"sound"` Video VideoDeviceXML `xml:"video" json:"video"` Channels []ChannelDeviceXML `xml:"channel" json:"channel"` }
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"` }
type Domain ¶
type Domain struct { libvirt.Domain // contains filtered or unexported fields }
func ListDomains ¶
func LookupDomainByUUIDName ¶
func NewDomainFromVir ¶
func NewDomainFromVir(dom *libvirt.Domain, hyper *HyperVisor) *Domain
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"` Features FeaturesXML `xml:"features" json:"features"` CPU CPUXML `xml:"cpu" json:"cpu"` VCPU VCPUXML `xml:"vcpu" json:"vcpu"` Memory MemXML `xml:"memory" json:"memory"` CurMem CurMemXML `xml:"currentMemory" json:"currentMemory"` Devices DevicesXML `xml:"devices" json:"devices"` }
func NewDomainXMLFromDom ¶
type FeaturesXML ¶
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"` }
type HyperListener ¶
type HyperVisor ¶
type HyperVisor struct { Url string Schema string Address string Path string Host string Conn *libvirt.Connect Listener []HyperListener ConnedTime int64 Lock sync.RWMutex Ticker *time.Ticker CpuSts *libvirt.NodeCPUStats Done chan bool IdleUtil uint64 DomUtil map[string]uint64 }
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 ¶
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 ¶
func (h *HyperVisor) LoopForever()
func (*HyperVisor) Open ¶
func (h *HyperVisor) Open() error
func (*HyperVisor) SetUrl ¶
func (h *HyperVisor) SetUrl(name string)
func (*HyperVisor) UpTime ¶
func (h *HyperVisor) UpTime() int64
type InputDeviceXML ¶
type InterfaceDriverXML ¶
type InterfaceMacXML ¶
type InterfaceModelXML ¶
type InterfaceSourceXML ¶
type InterfaceSourceXML struct { XMLName xml.Name `xml:"source" json:"-"` Bridge string `xml:"bridge,attr,omitempty" json:"bridge"` Network string `xml:"network,attr,omitempty" json:"network"` Address *AddressXML `xml:"address,omitempty" json:"address"` }
type InterfaceTargetXML ¶
type InterfaceVirPortXML ¶
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"` Driver *InterfaceDriverXML `xml:"driver" json:"driver"` Target InterfaceTargetXML `xml:"target" json:"target"` VirtualPort *InterfaceVirPortXML `xml:"virtualport,omitempty" json:"virtualport"` Address *AddressXML `xml:"address,omitempty" json:"address"` }
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"` }
type SnapshotXML ¶
type SnapshotXML struct { XMLName xml.Name `xml:"domainsnapshot" json:"-"` Name string `xml:"name,omitempty" json:"name"` State string `xml:"state,omitempty" json:"state"` CreateAt int64 `xml:"creationTime,omitempty" json:"creationTime"` IsCurrent bool `xml:"-" json:"-"` }
func NewSnapshotXMLFromDom ¶
func NewSnapshotXMLFromDom(ds *libvirt.DomainSnapshot) *SnapshotXML
type SoundDeviceXML ¶
type VideoDeviceXML ¶
type VideoDeviceXML struct { XMLName xml.Name `xml:"video" json:"-"` Model VideoModelXML `xml:"model" json:"model"` }
type VideoModelXML ¶
Click to show internal directories.
Click to hide internal directories.