directvolume

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceTypeBlock     = "block"
	DeviceTypeNFS       = "nfs"
	DeviceTypeCPFS      = "cpfs-nfs"
	DeviceTypePCI       = "pci"
	DeviceTypeDFBusPort = "dfbus"

	RunD2MountInfoFileName = "vol_data.json"
	RunD3MountInfoFileName = "vol_attr.json"

	// BlockFileModeReadWrite decimal value of 660 (-rw-rw---)
	BlockFileModeReadWrite = "432"
	// BlockFileModeReadOnly decimal value of 440 (-r--r----)
	BlockFileModeReadOnly = "288"
)

Variables

This section is empty.

Functions

func Add

func Add(volumePath string, mountInfo string) error

Add writes the mount info of a direct volume into a filesystem path known to Kata Container.

func AddMountInfo

func AddMountInfo(volumePath string, mountInfo MountInfo) error

func IsRunD2VolumePath

func IsRunD2VolumePath(volumePath string) bool

func IsRunDVolumeAlreadyMount

func IsRunDVolumeAlreadyMount(volumePath string) bool

IsRunDVolumeAlreadyMount checks if a RunDVolume is already mounted

func Remove

func Remove(volumePath string) error

Remove deletes the direct volume path including all the files inside it.

Types

type MountInfo

type MountInfo struct {
	Source     string            `json:"Source"`     // 设备标识
	DeviceType string            `json:"DeviceType"` // 设备类型
	MountOpts  []string          `json:"MountOpts"`  // 挂载方式及属性
	Extra      map[string]string `json:"Extra"`      // 扩展字段
	FSType     string            `json:"FSType"`     // 文件系统类型
}

MountInfo contains the information needed by Rund to consume a host block device and mount it as a filesystem inside the guest VM.

func IsRunD3VolumePath

func IsRunD3VolumePath(volumePath string) (*MountInfo, bool)

func VolumeMountInfo

func VolumeMountInfo(volumePath string) (*MountInfo, error)

VolumeMountInfo retrieves the mount info of a direct volume.

Jump to

Keyboard shortcuts

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