libvirtdriver

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CloseHyper

func CloseHyper(name string)

Types

type CurMemXML

type CurMemXML struct {
	XMLName xml.Name `xml:"currentMemory" json:"-"`
	Type    string   `xml:"unit,attr" json:"unit"`
	Value   string   `xml:",chardata" json:"value"`
}

func (*CurMemXML) Decode

func (cmem *CurMemXML) Decode(xmlData string) error

type DevicesXML

type DevicesXML struct {
	XMLName  xml.Name      `xml:"devices" json:"-"`
	Graphics []GraphicsXML `xml:"graphics" json:"graphics"`
	Disks    []DiskXML     `xml:"disk" json:"disk"`
}

func (*DevicesXML) Decode

func (devices *DevicesXML) Decode(xmlData string) error

type DiskDriverXML

type DiskDriverXML struct {
	XMLName xml.Name `xml:"driver" json:"-"`
	Type    string   `xml:"type,attr" json:"type"`
	Name    string   `xml:"name,attr" json:"name"`
}

func (*DiskDriverXML) Decode

func (drv *DiskDriverXML) Decode(xmlData string) error

type DiskSourceXML

type DiskSourceXML struct {
	XMLName xml.Name `xml:"source" json:"-"`
	File    string   `xml:"file,attr,omitempty" json:"file,omitempty"`
	Device  string   `xml:"device,attr,omitempty" json:"device,omitempty"`
}

func (*DiskSourceXML) Decode

func (src *DiskSourceXML) Decode(xmlData string) error

type DiskTargetXML

type DiskTargetXML struct {
	XMLName xml.Name `xml:"target" json:"-"`
	Bus     string   `xml:"bus,attr" json:"bus"`
	Dev     string   `xml:"dev,attr" json:"dev"`
}

func (*DiskTargetXML) Decode

func (tgt *DiskTargetXML) Decode(xmlData string) error

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"`
}

func (*DiskXML) Decode

func (disk *DiskXML) Decode(xmlData string) error

type Domain

type Domain struct {
	libvirt.Domain
}

func LookupDomainByUUIDName

func LookupDomainByUUIDName(uuid string) (*Domain, error)

func LookupDomainByUUIDString

func LookupDomainByUUIDString(uuid string) (*Domain, error)

func NewDomainFromVir

func NewDomainFromVir(dom *libvirt.Domain) *Domain

func (*Domain) GetXMLDesc

func (d *Domain) GetXMLDesc(secure bool) (string, error)

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"`
	Name    string     `xml:"name" json:"name"`
	Uuid    string     `xml:"uuid" json:"uuid"`
	Devices DevicesXML `xml:"devices" json:"devices"`
	Memory  MemXML     `xml:"memory" json:"memory"`
	CurMem  CurMemXML  `xml:"currentMemory" json:"currentMemory"`
	VCPUXml VCPUXML    `xml:"vcpu" json:"vcpu"`
	OS      OSXML      `xml:"os" json:"os"`
}

func NewDomainXMLFromDom

func NewDomainXMLFromDom(dom *Domain, secure bool) *DomainXML

func (*DomainXML) Decode

func (domain *DomainXML) Decode(xmlData string) error

func (*DomainXML) Encode

func (domain *DomainXML) Encode() string

func (*DomainXML) VNCDisplay

func (domain *DomainXML) VNCDisplay() (string, string)

type GraphicsXML

type GraphicsXML struct {
	XMLName xml.Name `xml:"graphics" json:"-"`
	Type    string   `xml:"type,attr" json:"type"`
	Port    string   `xml:"port,attr" json:"port"`
	Listen  string   `xml:"listen,attr" json:"listen"`
}

func (*GraphicsXML) Decode

func (graphics *GraphicsXML) Decode(xmlData string) error

type HyperVisor

type HyperVisor struct {
	Name    string
	Schema  string
	Address string
	Path    string
	Conn    *libvirt.Connect
}

func GetHyper

func GetHyper() (*HyperVisor, error)

func SetHyper

func SetHyper(name string) (*HyperVisor, error)

func (*HyperVisor) DomainDefineXML

func (h *HyperVisor) DomainDefineXML(xmlConfig string) (*Domain, error)

func (*HyperVisor) GetCPU

func (h *HyperVisor) GetCPU() (int, string)

func (*HyperVisor) GetMem

func (h *HyperVisor) GetMem() (uint64, uint64, float64)

func (*HyperVisor) GetRootfs

func (h *HyperVisor) GetRootfs() string

func (*HyperVisor) Init

func (h *HyperVisor) Init()

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)

type MemXML

type MemXML struct {
	XMLName xml.Name `xml:"memory" json:"-"`
	Type    string   `xml:"unit,attr" json:"unit"`
	Value   string   `xml:",chardata" json:"value"`
}

func (*MemXML) Decode

func (mem *MemXML) Decode(xmlData string) error

type OSBootXML

type OSBootXML struct {
	XMLName xml.Name `xml:"boot" json:"-"`
	Dev     string   `xml:"dev,attr" json:"dev"`
}

func (*OSBootXML) Decode

func (osb *OSBootXML) Decode(xmlData string) error

type OSTypeXML

type OSTypeXML struct {
	XMLName xml.Name `xml:"type" json:"-"`
	Arch    string   `xml:"arch,attr" json:"arch"`
	Machine string   `xml:"machine,attr" json:"machine"`
	Value   string   `xml:",chardata" json:"value"`
}

func (*OSTypeXML) Decode

func (ost *OSTypeXML) Decode(xmlData string) error

type OSXML

type OSXML struct {
	XMLName xml.Name    `xml:"os" json:"-"`
	Type    OSTypeXML   `xml:"type" json:"type"`
	Boot    []OSBootXML `xml:"boot" json:"boot"`
}

func (*OSXML) Decode

func (osx *OSXML) Decode(xmlData string) error

type VCPUXML

type VCPUXML struct {
	XMLName   xml.Name `xml:"vcpu" json:"-"`
	Placement string   `xml:"placement,attr" json:"placement"`
	Value     string   `xml:",chardata" json:"Value"`
}

func (*VCPUXML) Decode

func (cpu *VCPUXML) Decode(xmlData string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL