vpmem

package
v0.15.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

The controller manages all VPMem attached devices and guest mounted directories.

It is required that all callers:

1. Obtain a reservation using Reserve().

2. Use the reservation to Mount() to ensure resource availability.

3. Call Unmount() to release the reservation and all resources.

If Mount() fails, the caller must call Unmount() to release the reservation and all resources.

If Unmount() fails, the caller must call Unmount() again until it succeeds to release the reservation and all resources.

func New

func New(maxDevices uint32, vm VMVPMemOps, guest LinuxGuestVPMemOps) *Controller

func (*Controller) Mount

func (c *Controller) Mount(ctx context.Context, reservation uuid.UUID) (string, error)

func (*Controller) Reserve

func (c *Controller) Reserve(ctx context.Context, deviceConfig device.DeviceConfig, mountConfig mount.MountConfig) (uuid.UUID, error)

Reserve creates a referenced counted mapping entry for a VPMem attachment based on the device host path.

If an error is returned from this function, it is guaranteed that no reservation mapping was made and no Unmount() call is necessary to clean up.

func (*Controller) Unmount

func (c *Controller) Unmount(ctx context.Context, reservation uuid.UUID) error

type VMVPMemOps

type VMVPMemOps interface {
	device.VMVPMemAdder
	device.VMVPMemRemover
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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