dm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoopDevice

func NewLoopDevice(file string, readOnly bool) *loopDevice

Types

type Device

type Device struct {
	*api.PoolDevice
	// contains filtered or unexported fields
}

func (*Device) CreateSnapshot

func (d *Device) CreateSnapshot(size meta.Size, metadataPath string) (*Device, error)

func (*Device) Import

func (d *Device) Import(src source.Source) (*util.MountPoint, error)

func (*Device) Path

func (d *Device) Path() string

type Pool

type Pool struct {
	api.Pool
	// contains filtered or unexported fields
}

func NewPool

func NewPool(poolMeta *api.Pool) *Pool

NewPool creates a new Pool object The Pool is stateless, so this can also be used to load a configuration

func (*Pool) CreateVolume

func (p *Pool) CreateVolume(size meta.Size, metadataPath string) (*Device, error)

func (*Pool) ForDevices

func (p *Pool) ForDevices(iterFunc func(meta.DMID, *Device) error) error

This is a custom iterator to iterate over existing devices only (it skips nil slots)

func (*Pool) GetDevice

func (p *Pool) GetDevice(id meta.DMID) *Device

GetDevice dynamically spawns a device from a api.PoolDevice

func (*Pool) Path

func (p *Pool) Path() string

func (*Pool) Remove

func (p *Pool) Remove(id meta.DMID)

func (*Pool) Size

func (p *Pool) Size() int

Jump to

Keyboard shortcuts

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