nbd

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATH_TYPE_UNKNOWN = 0
	LVM_PATH          = 1
	NON_LVM_PATH      = 2
)
View Source
const MAX_TRIES = 3

Variables

This section is empty.

Functions

func Init

func Init() error

func QemuNbdConnect

func QemuNbdConnect(imageInfo qemuimg.SImageInfo, nbddev string) error

func QemuNbdDisconnect

func QemuNbdDisconnect(nbddev string) error

Types

type NBDDriver

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

func NewNBDDriver

func NewNBDDriver(imageInfo qemuimg.SImageInfo) *NBDDriver

func (*NBDDriver) Connect

func (d *NBDDriver) Connect(*apis.GuestDesc) error

func (*NBDDriver) DeployGuestfs

func (d *NBDDriver) DeployGuestfs(req *apis.DeployParams) (res *apis.DeployGuestFsResponse, err error)

func (*NBDDriver) DetectIsUEFISupport

func (d *NBDDriver) DetectIsUEFISupport(rootfs fsdriver.IRootFsDriver) bool

func (*NBDDriver) Disconnect

func (d *NBDDriver) Disconnect() error

func (*NBDDriver) FormatFs

func (d *NBDDriver) FormatFs(req *apis.FormatFsParams) (*apis.Empty, error)

func (*NBDDriver) FormatPartition

func (d *NBDDriver) FormatPartition(fs, uuid string) error

func (*NBDDriver) GetPartitions

func (d *NBDDriver) GetPartitions() []fsdriver.IDiskPartition

func (*NBDDriver) IsLVMPartition

func (d *NBDDriver) IsLVMPartition() bool

func (*NBDDriver) MakePartition

func (d *NBDDriver) MakePartition(fs string) error

func (*NBDDriver) MountRootfs

func (d *NBDDriver) MountRootfs(readonly bool) (fsdriver.IRootFsDriver, error)

func (*NBDDriver) ProbeImageInfo

func (d *NBDDriver) ProbeImageInfo(req *apis.ProbeImageInfoPramas) (*apis.ImageInfo, error)

func (*NBDDriver) ResizeFs

func (d *NBDDriver) ResizeFs() (*apis.Empty, error)

func (*NBDDriver) ResizePartition

func (d *NBDDriver) ResizePartition() error

func (*NBDDriver) SaveToGlance

func (d *NBDDriver) SaveToGlance(req *apis.SaveToGlanceParams) (*apis.SaveToGlanceResponse, error)

func (*NBDDriver) UmountRootfs

func (d *NBDDriver) UmountRootfs(fd fsdriver.IRootFsDriver) error

func (*NBDDriver) Zerofree

func (d *NBDDriver) Zerofree()

type SImageProp

type SImageProp struct {
	HasLVMPartition bool
	// contains filtered or unexported fields
}

type SKVMGuestLVMPartition

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

func NewKVMGuestLVMPartition

func NewKVMGuestLVMPartition(partDev string, vg SVG) *SKVMGuestLVMPartition

func (*SKVMGuestLVMPartition) FindPartitions

func (p *SKVMGuestLVMPartition) FindPartitions() []*kvmpart.SKVMGuestDiskPartition

func (*SKVMGuestLVMPartition) PutdownDevice

func (p *SKVMGuestLVMPartition) PutdownDevice() bool

func (*SKVMGuestLVMPartition) SetupDevice

func (p *SKVMGuestLVMPartition) SetupDevice() bool

func (*SKVMGuestLVMPartition) UmountPartitions

func (p *SKVMGuestLVMPartition) UmountPartitions() error

type SLVMImageConnectUniqueToolSet

type SLVMImageConnectUniqueToolSet struct {
	*sync.Map
	// contains filtered or unexported fields
}

func NewLVMImageConnectUniqueToolSet

func NewLVMImageConnectUniqueToolSet() *SLVMImageConnectUniqueToolSet

func (*SLVMImageConnectUniqueToolSet) Acquire

func (s *SLVMImageConnectUniqueToolSet) Acquire(imagePath string) (int, *sync.Mutex)

func (*SLVMImageConnectUniqueToolSet) CacheNonLvmImagePath

func (s *SLVMImageConnectUniqueToolSet) CacheNonLvmImagePath(imagePath string)

type SNBDManager

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

func GetNBDManager

func GetNBDManager() *SNBDManager

func NewNBDManager

func NewNBDManager() (*SNBDManager, error)

func (*SNBDManager) AcquireNbddev

func (m *SNBDManager) AcquireNbddev() string

func (*SNBDManager) ReleaseNbddev

func (m *SNBDManager) ReleaseNbddev(nbddev string)

type SVG

type SVG struct {
	Id   string
	Name string
}

Jump to

Keyboard shortcuts

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