libvirt

package
v0.0.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// URI for running in test mode
	TestURI = "test:///default"

	// Known domain states
	DomainRunning     = "running"
	DomainNoState     = "unknown"
	DomainBlocked     = "blocked"
	DomainPaused      = "paused"
	DomainShutdown    = "shutdown"
	DomainCrashed     = "crashed"
	DomainPMSuspended = "pmsuspended"
	DomainShutOff     = "shutoff"

	Name = "libvirt" // Name of the provider.
)

Variables

View Source
var (
	ErrConnectionClosed = errors.New("libvirt connection is closed")
	ErrDomainExists     = errors.New("the domain exists already")
	ErrDomainNotFound   = fmt.Errorf("domain %w", errs.ErrNotFound)
	ErrPoolNotFound     = fmt.Errorf("storage pool %w", errs.ErrNotFound)
)

Functions

func ConfigSpec

func ConfigSpec() *hclspec.Spec

ConfigSpec returns the HCL spec for the libvirt provider configuration.

func ModifyMountFsAvailability

func ModifyMountFsAvailability(fn mountFsAvailabilityFn)

ModifyMountFsAvailability is provided for testing to override the available filesystems for guest mounts.

func New

func New(ctx context.Context, logger hclog.Logger, opt ...Option) *provider

Types

type Config

type Config struct {
	URI                 string `codec:"uri"`
	User                string `codec:"user"`
	Password            string `codec:"password"`
	AllowInsecureMounts bool   `codec:"allow_insecure_readonly_mounts"`
}

Configuration supported by this provider.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the libvirt configuration.

type Option

type Option func(*provider)

func WithAuth

func WithAuth(user, password string) Option

func WithConfig

func WithConfig(c *Config) Option

func WithConnectionURI

func WithConnectionURI(URI string) Option

Directories

Path Synopsis
plugin/ceph command

Jump to

Keyboard shortcuts

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