libvirt

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DomainStateMap = map[DomainState]string{
	libvirt.DomainNostate:     "UNDEFINED",
	libvirt.DomainRunning:     "UP",
	libvirt.DomainBlocked:     "BLOCKED",
	libvirt.DomainPaused:      "PAUSED",
	libvirt.DomainShutdown:    "DOWN",
	libvirt.DomainCrashed:     "CRASHED",
	libvirt.DomainPmsuspended: "PMSUSPENDED",
	libvirt.DomainShutoff:     "DOWN",
}

DomainStateMap stringifies the state of a domain

Functions

This section is empty.

Types

type Address added in v0.23.0

type Address struct {
	Type     string `xml:"type,attr,omitempty"`
	Domain   string `xml:"domain,attr"`
	Bus      string `xml:"bus,attr"`
	Slot     string `xml:"slot,attr"`
	Function string `xml:"function,attr"`
}

Address describes the XML coding of the pci addres of an interface in libvirt

type Domain added in v0.23.0

type Domain struct {
	Interfaces  []Interface `xml:"devices>interface"`
	HostDevices []HostDev   `xml:"devices>hostdev"`
}

Domain is the subset of XML coding of a domain in libvirt

type DomainState added in v0.23.0

type DomainState = libvirt.DomainState

DomainState describes the state of a domain

type HostDev added in v0.23.0

type HostDev struct {
	Managed string `xml:"managed,attr,omitempty"`
	Mode    string `xml:"mode,attr,omitempty"`
	Type    string `xml:"type,attr,omitempty"`
	Driver  *struct {
		Name string `xml:"name,attr"`
	} `xml:"driver"`
	Alias *struct {
		Name string `xml:"name,attr"`
	} `xml:"alias"`
	Source  *Source     `xml:"source"`
	Address *Address    `xml:"address"`
	Host    *graph.Node `xml:"-"`
}

HostDev is the XML coding of an host device attached to a domain in libvirt

type Interface added in v0.23.0

type Interface struct {
	Type string `xml:"type,attr,omitempty"`
	Mac  *struct {
		Address string `xml:"address,attr"`
	} `xml:"mac"`
	Target *struct {
		Device string `xml:"dev,attr"`
	} `xml:"target"`
	Source  *Source `xml:"source"`
	Address Address `xml:"address"`
	Alias   *struct {
		Name string `xml:"name,attr"`
	} `xml:"alias"`
	Host *graph.Node `xml:"-"`
}

Interface is XML coding of an interface in libvirt

func (*Interface) ProcessNode added in v0.23.0

func (itf *Interface) ProcessNode(g *graph.Graph, node *graph.Node) bool

ProcessNode adds the libvirt interface information to a node of the graph

type Probe

type Probe struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Probe is the libvirt probe

func NewProbe added in v0.23.0

func NewProbe(g *graph.Graph, uri string, root *graph.Node) *Probe

NewProbe creates a libvirt topology probe

func NewProbeFromConfig

func NewProbeFromConfig(g *graph.Graph, root *graph.Node) (*Probe, error)

NewProbeFromConfig initializes the probe

func (*Probe) Start

func (probe *Probe) Start()

Start get all domains attached to a libvirt connection

func (*Probe) Stop

func (probe *Probe) Stop()

Stop stops the probe

type Source added in v0.23.0

type Source struct {
	Address *Address `xml:"address"`
}

Source describe the XML coding of a libvirt source

Jump to

Keyboard shortcuts

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