pools

package
v0.0.0-...-41fedb6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoragePoolTypeGeneric StoragePoolType = "generic"
	ImageFormatRaw         ImageFormat     = "raw"
)
View Source
const (
	StoragePoolTypeDir StoragePoolType = "dir"
	ImageFormatQcow2   ImageFormat     = "qcow2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirPool

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

DirPool is a StoragePool of type "dir"

func (DirPool) CreateVolume

func (p DirPool) CreateVolume(name string, sizeGB uint64) (*libvirt.StorageVol, error)

func (DirPool) DeleteVolume

func (p DirPool) DeleteVolume(name string) error

func (DirPool) GetDomainDiskXML

func (p DirPool) GetDomainDiskXML(name string) libvirtxml.DomainDisk

func (DirPool) GetVolumeName

func (p DirPool) GetVolumeName(name string) string

func (DirPool) ImageFormat

func (p DirPool) ImageFormat() ImageFormat

func (DirPool) LookupVolume

func (p DirPool) LookupVolume(name string) (*libvirt.StorageVol, error)

func (DirPool) ResizeVolume

func (p DirPool) ResizeVolume(name string, newDiskSizeGB uint64) error

func (DirPool) Type

func (p DirPool) Type() StoragePoolType

type GenericPool

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

GenericPool is a StoragePool of most pool types other than dir (lvm, gluster, etc)

func NewGenericPool

func NewGenericPool(pool *libvirt.StoragePool) (GenericPool, error)

NewGenericPool creates a wrapper for a generic pool

func (GenericPool) CreateVolume

func (p GenericPool) CreateVolume(name string, sizeGB uint64) (*libvirt.StorageVol, error)

func (GenericPool) DeleteVolume

func (p GenericPool) DeleteVolume(name string) error

func (GenericPool) GetDomainDiskXML

func (p GenericPool) GetDomainDiskXML(name string) libvirtxml.DomainDisk

func (GenericPool) GetVolumeName

func (p GenericPool) GetVolumeName(name string) string

func (GenericPool) ImageFormat

func (p GenericPool) ImageFormat() ImageFormat

func (GenericPool) LookupVolume

func (p GenericPool) LookupVolume(name string) (*libvirt.StorageVol, error)

func (GenericPool) ResizeVolume

func (p GenericPool) ResizeVolume(name string, newDiskSizeGB uint64) error

func (GenericPool) Type

func (p GenericPool) Type() StoragePoolType

type ImageFormat

type ImageFormat string

type StoragePool

type StoragePool interface {
	CreateVolume(string, uint64) (*libvirt.StorageVol, error)
	DeleteVolume(string) error
	GetVolumeName(string) string
	ResizeVolume(string, uint64) error
	GetDomainDiskXML(string) libvirtxml.DomainDisk
	LookupVolume(string) (*libvirt.StorageVol, error)
	Type() StoragePoolType
	ImageFormat() ImageFormat
}

StoragePool is an interface for the functionality around a type of libvirt.StoragePool

func GetPool

func GetPool(conn *libvirt.Connect) (StoragePool, error)

GetPool retrieves the configured Storage Pool from libvirt

func NewDirPool

func NewDirPool(pool *libvirt.StoragePool) (StoragePool, error)

NewDirPool creates a storage pool of type dir

type StoragePoolType

type StoragePoolType string

Jump to

Keyboard shortcuts

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