Documentation ¶
Index ¶
- Constants
- func DmsetupCreate(dmDeviceName, table string, executor *commonns.Executor) error
- func DmsetupDeps(dmDeviceName string, executor *commonns.Executor) ([]string, error)
- func DmsetupReload(dmDeviceName, table string, executor *commonns.Executor) error
- func DmsetupRemove(dmDeviceName string, force, deferred bool, executor *commonns.Executor) error
- func DmsetupResume(dmDeviceName string, executor *commonns.Executor) error
- func DmsetupSuspend(dmDeviceName string, noflush, nolockfs bool, executor *commonns.Executor) error
- func DuplicateDevice(dev *LonghornBlockDevice, dest string) error
- func GetDeviceNumbers(devPath string, executor *commonns.Executor) (int, int, error)
- func GetDeviceSectorSize(devPath string, executor *commonns.Executor) (int64, error)
- func GetHostNamespacePath(hostProcPath string) string
- func GetKnownDevices(executor *commonns.Executor) (map[string]*LonghornBlockDevice, error)
- func GetLonghornDevicePath(name string) string
- func GetNvmeControllerNameFromNamespaceName(nsName string) string
- func GetNvmeDevicePath(name string) string
- func GetNvmeNamespaceNameFromControllerName(controllerName string, nsID int) string
- func IsBlockDevice(path string) (bool, error)
- func NewExecutor(hostProc string) (*commonns.Executor, error)
- func PrintObject(v interface{}) error
- func RemoveDevice(devPath string) error
- type BlockDevice
- type BlockDevices
- type DeviceInfo
- type LonghornBlockDevice
- type ProcessFinder
Constants ¶
const ( DevPath = "/dev" LonghornDevDir = "/longhorn" DefaultNVMeNamespaceID = 1 )
const ( DockerdProcess = "dockerd" ContainerdProcess = "containerd" ContainerdShimProcess = "containerd-shim" )
const (
BlockdevBinary = "blockdev"
)
Variables ¶
This section is empty.
Functions ¶
func DmsetupCreate ¶
DmsetupCreate creates a device mapper device with the given name and table
func DmsetupDeps ¶
DmsetupDeps returns the dependent devices of the device mapper device with the given name
func DmsetupReload ¶
DmsetupReload reloads the table of the device mapper device with the given name and table
func DmsetupRemove ¶
DmsetupRemove removes the device mapper device with the given name
func DmsetupResume ¶
DmsetupResume removes the device mapper device with the given name
func DmsetupSuspend ¶
DmsetupSuspend suspends the device mapper device with the given name
func DuplicateDevice ¶
func DuplicateDevice(dev *LonghornBlockDevice, dest string) error
DuplicateDevice creates a device node for the given device
func GetDeviceNumbers ¶
GetDeviceNumbers returns the major and minor numbers of the given device
func GetDeviceSectorSize ¶
GetDeviceSectorSize returns the sector size of the given device
func GetHostNamespacePath ¶
func GetKnownDevices ¶
func GetKnownDevices(executor *commonns.Executor) (map[string]*LonghornBlockDevice, error)
GetKnownDevices returns the path of the device with the given major and minor numbers
func GetLonghornDevicePath ¶
func GetNvmeDevicePath ¶
func IsBlockDevice ¶
IsBlockDevice returns true if the given path is a block device
func NewExecutor ¶
NewExecutor creates a new namespaced executor
func PrintObject ¶
func PrintObject(v interface{}) error
Types ¶
type BlockDevice ¶
type BlockDevice struct { Name string `json:"name"` Major int `json:"maj"` Minor int `json:"min"` MajMin string `json:"maj:min"` }
func DetectDevice ¶
func DetectDevice(path string, executor *commonns.Executor) (*BlockDevice, error)
DetectDevice detects the device with the given path
type BlockDevices ¶
type BlockDevices struct {
Devices []BlockDevice `json:"blockdevices"`
}
type DeviceInfo ¶
type DeviceInfo struct { Name string BlockDeviceName string TableLive bool TableInactive bool Suspended bool ReadOnly bool Major uint32 Minor uint32 OpenCount uint32 // Open reference count TargetCount uint32 // Number of targets in the live table EventNumber uint32 // Last event sequence number (used by wait) }
func DmsetupInfo ¶
func DmsetupInfo(dmDeviceName string, executor *commonns.Executor) ([]*DeviceInfo, error)
DmsetupInfo returns the information of the device mapper device with the given name
type LonghornBlockDevice ¶
type LonghornBlockDevice struct { Nvme BlockDevice Export BlockDevice }
type ProcessFinder ¶
type ProcessFinder struct {
// contains filtered or unexported fields
}
func NewProcessFinder ¶
func NewProcessFinder(procPath string) *ProcessFinder
func (*ProcessFinder) FindAncestorByName ¶
func (p *ProcessFinder) FindAncestorByName(ancestorProcess string) (*linuxproc.ProcessStatus, error)
func (*ProcessFinder) FindPid ¶
func (p *ProcessFinder) FindPid(pid int64) (*linuxproc.ProcessStatus, error)
func (*ProcessFinder) FindSelf ¶
func (p *ProcessFinder) FindSelf() (*linuxproc.ProcessStatus, error)