driver

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterController

func RegisterController(srv *grpc.Server, identity csi.IdentityServer, controller csi.ControllerServer)

func RegisterNode

func RegisterNode(srv *grpc.Server, identity csi.IdentityServer, node csi.NodeServer)

Types

type Disk

type Disk struct {
	XMLName xml.Name `xml:"disk"`
	Type    string   `xml:"type,attr"`
	Device  string   `xml:"device,attr"`
	Alias   struct {
		Name string `xml:"name,attr"`
	} `xml:"alias"`
	Driver struct {
		Name string `xml:"name,attr"`
		Type string `xml:"type,attr"`
	} `xml:"driver"`
	Source struct {
		File string `xml:"file,attr"`
	} `xml:"source"`
	Target struct {
		Dev string `xml:"dev,attr"`
		Bus string `xml:"bus,attr"`
	} `xml:"target"`
	Serial string `xml:"serial"`
}

type Domain

type Domain struct {
	XMLName xml.Name `xml:"domain"`
	Name    string   `xml:"name"`
	UUID    string   `xml:"uuid"`
	Devices struct {
		Disks []Disk `xml:"disk"`
	} `xml:"devices"`
}

type Driver

type Driver struct {
	Name     string
	Version  string
	Endpoint string

	Hypervisors *hypervisor.Hypervisors
	Logger      *zap.Logger
	// contains filtered or unexported fields
}

func ProvideControllerDriver added in v0.2.1

func ProvideControllerDriver(config *config.Config, hypervisors *hypervisor.Hypervisors, log *zap.Logger) *Driver

func ProvideNodeDriver added in v0.2.1

func ProvideNodeDriver(config *config.Config, log *zap.Logger) *Driver

func (*Driver) AttachDisk added in v0.3.5

func (d *Driver) AttachDisk(lv *libvirt.Libvirt, domainXml, disk, serial string) error

func (*Driver) DettachDisk added in v0.3.5

func (d *Driver) DettachDisk(lv *libvirt.Libvirt, domainXml, serial string) error

func (*Driver) DiskAttachedToNodes

func (d *Driver) DiskAttachedToNodes(ctx context.Context, lv *libvirt.Libvirt, file string) ([]string, error)

func (*Driver) DiskLock

func (d *Driver) DiskLock(poolName, name string) func()

func (*Driver) EncodeNumberToAlphabet

func (d *Driver) EncodeNumberToAlphabet(number int) string

func (*Driver) LookupDomainDisks

func (d *Driver) LookupDomainDisks(xmlDesc string) ([]Disk, error)

func (*Driver) Template

func (d *Driver) Template(name string, data any) string

Jump to

Keyboard shortcuts

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