dominfo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Return information for all domains on our host.
	Get(
		virt *libvirt.Libvirt,
		flags ...libvirt.ConnectListAllDomainsFlags,
	) ([]DomainInfo, error)
}

Client that returns information for all domains on our host.

func NewClient

func NewClient() Client

Create a new domain info client.

func NewClientEmulator

func NewClientEmulator() Client

Create a new emulated domain info client.

type DomainAddress

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

DomainAddress represents a device address.

type DomainAlias

type DomainAlias struct {
	Name string `xml:"name,attr"`
}

DomainAlias represents a device alias.

type DomainBoot

type DomainBoot struct {
	Dev string `xml:"dev,attr"`
}

DomainBoot represents boot configuration.

type DomainCPU

type DomainCPU struct {
	Mode     string             `xml:"mode,attr,omitempty"`
	Topology *DomainCPUTopology `xml:"topology,omitempty"`
	Numa     *DomainCPUNuma     `xml:"numa,omitempty"`
}

DomainCPU represents CPU configuration.

type DomainCPUNuma

type DomainCPUNuma struct {
	Cells []DomainCPUNumaCell `xml:"cell"`
}

DomainCPUNuma represents CPU NUMA configuration.

type DomainCPUNumaCell

type DomainCPUNumaCell struct {
	ID        uint64 `xml:"id,attr"`
	CPUs      string `xml:"cpus,attr"`
	Memory    uint64 `xml:"memory,attr"`
	Unit      string `xml:"unit,attr"`
	MemAccess string `xml:"memAccess,attr,omitempty"`
}

DomainCPUNumaCell represents a NUMA cell.

type DomainCPUPin

type DomainCPUPin struct {
	CPUSet string `xml:"cpuset,attr"`
}

DomainCPUPin represents a CPU pinning configuration.

type DomainCPUTopology

type DomainCPUTopology struct {
	Sockets  int `xml:"sockets,attr"`
	Dies     int `xml:"dies,attr"`
	Clusters int `xml:"clusters,attr"`
	Cores    int `xml:"cores,attr"`
	Threads  int `xml:"threads,attr"`
}

DomainCPUTopology represents CPU topology.

type DomainCPUTune

type DomainCPUTune struct {
	VCPUPins    []DomainVCPUPin `xml:"vcpupin,omitempty"`
	EmulatorPin *DomainCPUPin   `xml:"emulatorpin,omitempty"`
}

DomainCPUTune represents CPU tuning configuration.

type DomainClock

type DomainClock struct {
	Offset string `xml:"offset,attr"`
}

DomainClock represents clock configuration.

type DomainDevices

type DomainDevices struct {
	Emulator   string            `xml:"emulator,omitempty"`
	Disks      []DomainDisk      `xml:"disk,omitempty"`
	Interfaces []DomainInterface `xml:"interface,omitempty"`
	Serials    []DomainSerial    `xml:"serial,omitempty"`
}

DomainDevices represents all devices.

type DomainDisk

type DomainDisk struct {
	Type   string            `xml:"type,attr"`
	Device string            `xml:"device,attr"`
	Driver *DomainDiskDriver `xml:"driver,omitempty"`
	Source *DomainDiskSource `xml:"source,omitempty"`
	Target *DomainDiskTarget `xml:"target,omitempty"`
	Alias  *DomainAlias      `xml:"alias,omitempty"`
}

DomainDisk represents a disk device.

type DomainDiskDriver

type DomainDiskDriver struct {
	Type    string `xml:"type,attr"`
	Cache   string `xml:"cache,attr,omitempty"`
	Discard string `xml:"discard,attr,omitempty"`
}

DomainDiskDriver represents disk driver configuration.

type DomainDiskSource

type DomainDiskSource struct {
	File string `xml:"file,attr,omitempty"`
}

DomainDiskSource represents disk source.

type DomainDiskTarget

type DomainDiskTarget struct {
	Dev string `xml:"dev,attr"`
	Bus string `xml:"bus,attr"`
}

DomainDiskTarget represents disk target.

type DomainHugePages

type DomainHugePages struct {
	Pages []DomainPage `xml:"page"`
}

DomainHugePages represents huge pages configuration.

type DomainInfo

type DomainInfo struct {
	Type          string               `xml:"type,attr"`
	ID            string               `xml:"id,attr,omitempty"`
	Name          string               `xml:"name"`
	UUID          string               `xml:"uuid"`
	Metadata      *DomainMetadata      `xml:"metadata,omitempty"`
	Memory        *DomainMemory        `xml:"memory,omitempty"`
	CurrentMemory *DomainMemory        `xml:"currentMemory,omitempty"`
	MemoryBacking *DomainMemoryBacking `xml:"memoryBacking,omitempty"`
	VCPU          *DomainVCPU          `xml:"vcpu,omitempty"`
	CPUTune       *DomainCPUTune       `xml:"cputune,omitempty"`
	NumaTune      *DomainNumaTune      `xml:"numatune,omitempty"`
	Resource      *DomainResource      `xml:"resource,omitempty"`
	OS            *DomainOS            `xml:"os,omitempty"`
	CPU           *DomainCPU           `xml:"cpu,omitempty"`
	Clock         *DomainClock         `xml:"clock,omitempty"`
	OnPoweroff    string               `xml:"on_poweroff,omitempty"`
	OnReboot      string               `xml:"on_reboot,omitempty"`
	OnCrash       string               `xml:"on_crash,omitempty"`
	Devices       *DomainDevices       `xml:"devices,omitempty"`
}

DomainInfo as returned from the libvirt dumpxml api.

The format is the same as returned when executing `virsh dumpxml`. See: https://www.libvirt.org/manpages/virsh.html#dumpxml For another reference see: https://gitlab.com/libvirt/libvirt-go-xml-module/-/blob/v1.11010.0/domain.go#L3237

type DomainInterface

type DomainInterface struct {
	Type    string                 `xml:"type,attr"`
	MAC     *DomainInterfaceMAC    `xml:"mac,omitempty"`
	Source  *DomainInterfaceSource `xml:"source,omitempty"`
	Target  *DomainInterfaceTarget `xml:"target,omitempty"`
	Model   *DomainInterfaceModel  `xml:"model,omitempty"`
	Driver  *DomainInterfaceDriver `xml:"driver,omitempty"`
	MTU     *DomainInterfaceMTU    `xml:"mtu,omitempty"`
	Alias   *DomainAlias           `xml:"alias,omitempty"`
	Address *DomainAddress         `xml:"address,omitempty"`
}

DomainInterface represents a network interface.

type DomainInterfaceDriver

type DomainInterfaceDriver struct {
	Queues string `xml:"queues,attr,omitempty"`
	Packed string `xml:"packed,attr,omitempty"`
}

DomainInterfaceDriver represents network driver.

type DomainInterfaceMAC

type DomainInterfaceMAC struct {
	Address string `xml:"address,attr"`
}

DomainInterfaceMAC represents MAC address.

type DomainInterfaceMTU

type DomainInterfaceMTU struct {
	Size int `xml:"size,attr"`
}

DomainInterfaceMTU represents MTU configuration.

type DomainInterfaceModel

type DomainInterfaceModel struct {
	Type string `xml:"type,attr"`
}

DomainInterfaceModel represents network model.

type DomainInterfaceSource

type DomainInterfaceSource struct {
	Bridge string `xml:"bridge,attr,omitempty"`
}

DomainInterfaceSource represents network source.

type DomainInterfaceTarget

type DomainInterfaceTarget struct {
	Dev string `xml:"dev,attr"`
}

DomainInterfaceTarget represents network target.

type DomainMemory

type DomainMemory struct {
	Unit  string `xml:"unit,attr"`
	Value int64  `xml:",chardata"`
}

DomainMemory represents memory configuration.

type DomainMemoryBacking

type DomainMemoryBacking struct {
	HugePages *DomainHugePages `xml:"hugepages,omitempty"`
}

DomainMemoryBacking represents memory backing configuration.

type DomainMetadata

type DomainMetadata struct {
	NovaInstance *NovaInstance `xml:"instance"`
}

DomainMetadata represents the metadata section containing OpenStack Nova information.

type DomainNumaMemNode

type DomainNumaMemNode struct {
	CellID  uint64 `xml:"cellid,attr"`
	Mode    string `xml:"mode,attr"`
	Nodeset string `xml:"nodeset,attr"`
}

DomainNumaMemNode represents a NUMA memory node configuration.

type DomainNumaMemory

type DomainNumaMemory struct {
	Mode    string `xml:"mode,attr"`
	Nodeset string `xml:"nodeset,attr"`
}

DomainNumaMemory represents NUMA memory configuration.

type DomainNumaTune

type DomainNumaTune struct {
	Memory   *DomainNumaMemory   `xml:"memory,omitempty"`
	MemNodes []DomainNumaMemNode `xml:"memnode,omitempty"`
}

DomainNumaTune represents NUMA tuning configuration.

type DomainOS

type DomainOS struct {
	Type   *DomainOSType `xml:"type,omitempty"`
	Kernel string        `xml:"kernel,omitempty"`
	Boot   *DomainBoot   `xml:"boot,omitempty"`
}

DomainOS represents OS configuration.

type DomainOSType

type DomainOSType struct {
	Arch  string `xml:"arch,attr"`
	Value string `xml:",chardata"`
}

DomainOSType represents the OS type.

type DomainPage

type DomainPage struct {
	Size    string `xml:"size,attr"`
	Unit    string `xml:"unit,attr"`
	Nodeset string `xml:"nodeset,attr,omitempty"`
}

DomainPage represents a huge page configuration.

type DomainResource

type DomainResource struct {
	Partition string `xml:"partition,omitempty"`
}

DomainResource represents resource configuration.

type DomainSerial

type DomainSerial struct {
	Type     string                `xml:"type,attr"`
	Source   *DomainSerialSource   `xml:"source,omitempty"`
	Protocol *DomainSerialProtocol `xml:"protocol,omitempty"`
	Log      *DomainSerialLog      `xml:"log,omitempty"`
	Target   *DomainSerialTarget   `xml:"target,omitempty"`
}

DomainSerial represents a serial device.

type DomainSerialLog

type DomainSerialLog struct {
	File   string `xml:"file,attr"`
	Append string `xml:"append,attr"`
}

DomainSerialLog represents serial log configuration.

type DomainSerialProtocol

type DomainSerialProtocol struct {
	Type string `xml:"type,attr"`
}

DomainSerialProtocol represents serial protocol.

type DomainSerialSource

type DomainSerialSource struct {
	Mode    string `xml:"mode,attr"`
	Host    string `xml:"host,attr"`
	Service string `xml:"service,attr"`
}

DomainSerialSource represents serial source.

type DomainSerialTarget

type DomainSerialTarget struct {
	Port int `xml:"port,attr"`
}

DomainSerialTarget represents serial target.

type DomainVCPU

type DomainVCPU struct {
	Placement string `xml:"placement,attr,omitempty"`
	Value     int    `xml:",chardata"`
}

DomainVCPU represents virtual CPU configuration.

type DomainVCPUPin

type DomainVCPUPin struct {
	VCPU   int    `xml:"vcpu,attr"`
	CPUSet string `xml:"cpuset,attr"`
}

DomainVCPUPin represents a VCPU pinning configuration.

type NovaFlavor

type NovaFlavor struct {
	Name      string `xml:"name,attr"`
	Memory    int    `xml:"memory"`
	Disk      int    `xml:"disk"`
	Swap      int    `xml:"swap"`
	Ephemeral int    `xml:"ephemeral"`
	VCPUs     int    `xml:"vcpus"`
}

NovaFlavor represents the instance flavor.

type NovaIP

type NovaIP struct {
	Type      string `xml:"type,attr"`
	Address   string `xml:"address,attr"`
	IPVersion string `xml:"ipVersion,attr"`
}

NovaIP represents an IP address.

type NovaInstance

type NovaInstance struct {
	XMLName      xml.Name     `xml:"http://openstack.org/xmlns/libvirt/nova/1.1 instance"`
	Package      *NovaPackage `xml:"package,omitempty"`
	Name         string       `xml:"name,omitempty"`
	CreationTime string       `xml:"creationTime,omitempty"`
	Flavor       *NovaFlavor  `xml:"flavor,omitempty"`
	Owner        *NovaOwner   `xml:"owner,omitempty"`
	Root         *NovaRoot    `xml:"root,omitempty"`
	Ports        *NovaPorts   `xml:"ports,omitempty"`
}

NovaInstance represents OpenStack Nova instance metadata.

type NovaOwner

type NovaOwner struct {
	User    *NovaUser    `xml:"user,omitempty"`
	Project *NovaProject `xml:"project,omitempty"`
}

NovaOwner represents the instance owner.

type NovaPackage

type NovaPackage struct {
	Version string `xml:"version,attr"`
}

NovaPackage represents the Nova package version.

type NovaPort

type NovaPort struct {
	UUID string   `xml:"uuid,attr"`
	IPs  []NovaIP `xml:"ip"`
}

NovaPort represents a network port.

type NovaPorts

type NovaPorts struct {
	Ports []NovaPort `xml:"port"`
}

NovaPorts represents the network ports.

type NovaProject

type NovaProject struct {
	UUID  string `xml:"uuid,attr"`
	Value string `xml:",chardata"`
}

NovaProject represents the project that owns the instance.

type NovaRoot

type NovaRoot struct {
	Type string `xml:"type,attr"`
	UUID string `xml:"uuid,attr"`
}

NovaRoot represents the root image.

type NovaUser

type NovaUser struct {
	UUID  string `xml:"uuid,attr"`
	Value string `xml:",chardata"`
}

NovaUser represents the user who owns the instance.

Jump to

Keyboard shortcuts

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