libvirt

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// The amount of retries to get the domain IP addresses
	GetDomainIPsRetries = 20
	// The sleep time between retries to get the domain IP addresses
	GetDomainIPsSleep = time.Second * 3
)

Variables

View Source
var ErrVolumeNotFound = errors.New("Domain not found")

ErrVolumeNotFound is returned when a domain is not found

Functions

func CreateDomain

func CreateDomain(ctx context.Context, libvirtClient *libvirtClient, v *vmConfig) (result *createDomainOutput, err error)

func DeleteDomain

func DeleteDomain(ctx context.Context, libvirtClient *libvirtClient, id string) (err error)

func GetDomainCapabilities added in v0.8.0

func GetDomainCapabilities(conn *libvirt.Connect, emulatorbin string, arch string, machine string, virttype string, flags uint32) (*libvirtxml.DomainCaps, error)

func NewLibvirtClient

func NewLibvirtClient(libvirtCfg Config) (*libvirtClient, error)

func NewProvider

func NewProvider(config *Config) (cloud.Provider, error)

Types

type Config

type Config struct {
	URI            string
	PoolName       string
	NetworkName    string
	DataDir        string
	DisableCVM     bool
	VolName        string
	LaunchSecurity string
	Firmware       string
}

type LaunchSecurityType added in v0.8.0

type LaunchSecurityType int
const (
	NoLaunchSecurity LaunchSecurityType = iota
	SEV
	S390PV
)

func GetLaunchSecurityType added in v0.8.0

func GetLaunchSecurityType(uri string) (LaunchSecurityType, error)

Attempts to determine launchSecurity Type from domain capabilities and hardware Currently only supports SEV and S390PV

func (LaunchSecurityType) String added in v0.8.0

func (l LaunchSecurityType) String() string

type Manager

type Manager struct{}

func (*Manager) LoadEnv

func (*Manager) LoadEnv()

func (*Manager) NewProvider

func (*Manager) NewProvider() (cloud.Provider, error)

func (*Manager) ParseCmd

func (*Manager) ParseCmd(flags *flag.FlagSet)

Jump to

Keyboard shortcuts

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