Documentation ¶
Index ¶
- Variables
- func ActualControllerNumber(_ context.Context, passedController uint8) (uint8, error)
- func GetDevicePath(ctx context.Context, controller, lun uint8, partition uint64) (_ string, err error)
- func Mount(ctx context.Context, controller, lun uint8, partition uint64, target string, ...) (err error)
- func Unmount(ctx context.Context, controller, lun uint8, partition uint64, target string, ...) (err error)
- func UnplugDevice(ctx context.Context, controller, lun uint8) (err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownFilesystem = errors.New("could not get device filesystem type")
Functions ¶
func ActualControllerNumber ¶ added in v0.10.0
ActualControllerNumber retrieves the actual controller number assigned to a SCSI controller with number `passedController`. When HCS creates the UVM it adds 4 SCSI controllers to the UVM but the 1st SCSI controller according to HCS can actually show up as 2nd, 3rd or 4th controller inside the UVM. So the i'th controller from HCS' perspective could actually be j'th controller inside the UVM. However, we can refer to the SCSI controllers with their GUIDs (that are hardcoded) and then using that GUID find out the SCSI controller number inside the guest. This function does exactly that.
func GetDevicePath ¶ added in v0.10.0
func GetDevicePath(ctx context.Context, controller, lun uint8, partition uint64) (_ string, err error)
GetDevicePath finds the `/dev/sd*` path to the SCSI device on `controller` index `lun` with partition index `partition`.
func Mount ¶
func Mount( ctx context.Context, controller, lun uint8, partition uint64, target string, readonly bool, options []string, config *Config) (err error)
Mount creates a mount from the SCSI device on `controller` index `lun` to `target`
`target` will be created. On mount failure the created `target` will be automatically cleaned up.
If the config has `encrypted` is set to true, the SCSI device will be encrypted using dm-crypt.
Types ¶
type Config ¶ added in v0.10.0
type Config struct { Encrypted bool VerityInfo *guestresource.DeviceVerityInfo EnsureFilesystem bool Filesystem string }
Config represents options that are used as part of setup/cleanup before mounting or after unmounting a device. This does not include options that are sent to the mount or unmount calls.