libvirt

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 38 Imported by: 7

Documentation

Overview

Package libvirt contains wrappers for converting schema ids to libvirt RFC4122 UUID type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupLibvirtConnections

func CleanupLibvirtConnections()

CleanupLibvirtConnections closes libvirt clients for all URIs.

func HasDHCP

func HasDHCP(net libvirtxml.Network) bool

HasDHCP checks if the network has a DHCP server managed by libvirt.

func Provider

func Provider() *schema.Provider

Provider libvirt.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client libvirt.

type Config

type Config struct {
	URI string
}

Config struct for the libvirt-provider.

func (*Config) Client

func (c *Config) Client() (*Client, error)

Client libvirt, returns a libvirt client for a config.

type DeviceDRM added in v0.8.0

type DeviceDRM struct {
	Device  xml.Name `xml:"device"`
	Name    string   `xml:"name"`
	Path    string   `xml:"path"`
	Parent  string   `xml:"parent"`
	Devnode []struct {
		Type string `xml:"type,attr"`
		Path string `xml:",chardata"`
	} `xml:"devnode"`
	Capability struct {
		Type    string `xml:"type,attr"`
		DRMType string `xml:"type"`
	} `xml:"capability"`
}

type DeviceGeneric added in v0.8.0

type DeviceGeneric struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Capability xml.Name `xml:"capability"`
		Type       string   `xml:"type,attr"`
	} `xml:"capability"`
}

strutures to parse device XML just enough to get Capability.Type.

type DeviceNet added in v0.8.0

type DeviceNet struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type      string `xml:"type,attr"`
		Interface string `xml:"interface"`
		Address   string `xml:"address"`
		Link      struct {
			Speed string `xml:"speed,attr"`
			State string `xml:"state,attr"`
		} `xml:"link"`
		Feature struct {
			Name []string `xml:"name,attr"`
		} `xml:"feature"`
		Cappability struct {
			Type string `xml:"type,attr"`
		} `xml:"capability"`
	} `xml:"capability"`
}

type DevicePCI added in v0.8.0

type DevicePCI struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type     string `xml:"type,attr"`
		Class    string `xml:"class"`
		Domain   int    `xml:"domain"`
		Bus      int    `xml:"bus"`
		Slot     int    `xml:"slot"`
		Function int    `xml:"function"`
		Product  struct {
			Name string `xml:",chardata"`
			ID   string `xml:"id,attr"`
		} `xml:"product"`
		Vendor struct {
			Name string `xml:",chardata"`
			ID   string `xml:"id,attr"`
		} `xml:"vendor"`
		IommuGroup struct {
			IommuGroup xml.Name `xml:"iommuGroup"`
			Number     int      `xml:"number,attr"`
			Addresses  []struct {
				Address  xml.Name `xml:"address"`
				Domain   string   `xml:"domain,attr"`
				Bus      string   `xml:"bus,attr"`
				Slot     string   `xml:"slot,attr"`
				Function string   `xml:"function,attr"`
			} `xml:"address"`
		} `xml:"iommuGroup"`
	} `xml:"capability"`
}

type DeviceSCSI added in v0.8.0

type DeviceSCSI struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type     string `xml:"type,attr"`
		Host     int    `xml:"host"`
		Bus      int    `xml:"bus"`
		Target   int    `xml:"target"`
		Lun      int    `xml:"lun"`
		ScsiType string `xml:"type"`
	} `xml:"capability"`
}

type DeviceSCSIHost added in v0.8.0

type DeviceSCSIHost struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type     string `xml:"type,attr"`
		Host     int    `xml:"host"`
		UniqueID int    `xml:"unique_id"`
	} `xml:"capability"`
}

type DeviceStorage added in v0.8.0

type DeviceStorage struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type             string `xml:"type,attr"`
		Block            string `xml:"block"`
		DriveType        string `xml:"drive_type"`
		Model            string `xml:"model"`
		Serial           string `xml:"serial"`
		Size             int    `xml:"size"`
		LogicalBlockSize int    `xml:"logical_block_size"`
		NumBlocks        int    `xml:"num_blocks"`
	} `xml:"capability"`
}

type DeviceSystem added in v0.8.0

type DeviceSystem struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type     string `xml:"type,attr"`
		Product  string `xml:"product"`
		Hardware struct {
			Vendor  string `xml:"vendor"`
			Version string `xml:"version"`
			Serial  string `xml:"serial"`
			UUID    string `xml:"uuid"`
		} `xml:"hardware"`
		Firmware struct {
			Vendor      string `xml:"vendor"`
			Version     string `xml:"version"`
			ReleaseDate string `xml:"release_date"`
		} `xml:"firmware"`
	} `xml:"capability"`
}

type DeviceUSB added in v0.8.0

type DeviceUSB struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type        string `xml:"type,attr"`
		Number      int    `xml:"number"`
		Class       int    `xml:"class"`
		Subclass    int    `xml:"subclass"`
		Protocol    int    `xml:"protocol"`
		Description string `xml:"description"`
	} `xml:"capability"`
}

type DeviceUSBDevice added in v0.8.0

type DeviceUSBDevice struct {
	Device     xml.Name `xml:"device"`
	Name       string   `xml:"name"`
	Path       string   `xml:"path"`
	Parent     string   `xml:"parent"`
	Capability struct {
		Type    string `xml:"type,attr"`
		Bus     string `xml:"bus"`
		Device  string `xml:"device"`
		Product struct {
			Name string `xml:",chardata"`
			ID   string `xml:"id,attr"`
		} `xml:"product"`
		Vendor struct {
			Name string `xml:",chardata"`
			ID   string `xml:"id,attr"`
		} `xml:"vendor"`
	} `xml:"capability"`
}

Directories

Path Synopsis
helper
Deals with https://libvirt.org/uri.html go-libvirt needs a working transport to talk rpc to libvirt.
Deals with https://libvirt.org/uri.html go-libvirt needs a working transport to talk rpc to libvirt.

Jump to

Keyboard shortcuts

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