scsi

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 SCSI attached devices and guest mounted directories.

It is required that all callers:

1. Obtain a reservation using Reserve().

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

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

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

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

func New

func New(numControllers int, vm VMSCSIOps, lGuest LinuxGuestSCSIOps, wGuest WindowsGuestSCSIOps) *Controller

func (*Controller) MapToGuest

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

func (*Controller) Reserve

func (c *Controller) Reserve(ctx context.Context, diskConfig disk.DiskConfig, mountConfig mount.MountConfig) (uuid.UUID, error)

Reserves a referenced counted mapping entry for a SCSI attachment based on the SCSI disk path, and partition number.

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

func (*Controller) ReserveForRootfs

func (c *Controller) ReserveForRootfs(ctx context.Context, controller, lun uint) error

ReserveForRootfs reserves a specific controller and lun location for the rootfs. This is required to ensure the rootfs is always at a known location and that location is not used for any other disk. This should only be called once per controller and lun location, and must be called before any calls to Reserve() to ensure the rootfs reservation is not evicted by a dynamic reservation.

func (*Controller) UnmapFromGuest

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

type VMSCSIOps

type VMSCSIOps interface {
	disk.VMSCSIAdder
	disk.VMSCSIRemover
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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