libvirt

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 19 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

func MetadataDecoder added in v0.24.0

func MetadataDecoder(raw json.RawMessage) (getter.Getter, error)

MetadataDecoder implements a json message raw decoder

func NewProbe added in v0.23.0

func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error)

NewProbe returns a new topology Libvirt probe

func Register added in v0.26.0

func Register()

Register registers graph metadata decoders

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 address 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 {
	Ctx     tp.Context `xml:"-"`
	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"`
}

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 {
	Ctx  tp.Context `xml:"-"`
	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"`
}

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 Metadata added in v0.24.0

type Metadata struct {
	MAC     string `json:",omitempty"`
	Domain  string `json:",omitempty"`
	BusType string `json:",omitempty"`
	BusInfo string `json:",omitempty"`
	Alias   string `json:",omitempty"`
}

Metadata describes the informations stored for a libvirt domain easyjson:json gendecoder

func (*Metadata) GetField added in v0.26.0

func (obj *Metadata) GetField(key string) (interface{}, error)

func (*Metadata) GetFieldBool added in v0.26.0

func (obj *Metadata) GetFieldBool(key string) (bool, error)

func (*Metadata) GetFieldInt64 added in v0.26.0

func (obj *Metadata) GetFieldInt64(key string) (int64, error)

func (*Metadata) GetFieldKeys added in v0.26.0

func (obj *Metadata) GetFieldKeys() []string

func (*Metadata) GetFieldString added in v0.26.0

func (obj *Metadata) GetFieldString(key string) (string, error)

func (Metadata) MarshalEasyJSON added in v0.26.0

func (v Metadata) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Metadata) MarshalJSON added in v0.26.0

func (v Metadata) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Metadata) MatchBool added in v0.26.0

func (obj *Metadata) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*Metadata) MatchInt64 added in v0.26.0

func (obj *Metadata) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*Metadata) MatchString added in v0.26.0

func (obj *Metadata) MatchString(key string, predicate getter.StringPredicate) bool

func (*Metadata) UnmarshalEasyJSON added in v0.26.0

func (v *Metadata) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Metadata) UnmarshalJSON added in v0.26.0

func (v *Metadata) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Probe

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

Probe is the libvirt probe

func (*Probe) Do added in v0.25.0

func (probe *Probe) Do(ctx context.Context, wg *sync.WaitGroup) error

Do get all domains attached to a libvirt connection

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