storage

package
v0.6.12 Latest Latest
Warning

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

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

Documentation

Overview

Package storage provides common storage and serial-console helpers for Apple Virtualization VMs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStorageDevices added in v0.6.11

func AppendStorageDevices(config vz.VZVirtualMachineConfiguration, devices ...vz.VZStorageDeviceConfiguration)

AppendStorageDevices appends devices to a VM configuration's storage devices.

func CreateBlockDevice

CreateBlockDevice creates a Virtio block device configuration.

func CreateBlockDeviceWithAttachment added in v0.6.11

func CreateBlockDeviceWithAttachment(attachment vz.VZStorageDeviceAttachment) (vz.VZVirtioBlockDeviceConfiguration, error)

CreateBlockDeviceWithAttachment creates a Virtio block device configuration.

func CreateDirectoryShare

func CreateDirectoryShare(path string, readOnly bool) (vz.VZSingleDirectoryShare, error)

CreateDirectoryShare creates a single-directory share for VirtioFS.

func CreateDiskAttachment

func CreateDiskAttachment(path string, readOnly bool) (vz.VZDiskImageStorageDeviceAttachment, error)

CreateDiskAttachment creates a disk image attachment for path.

func CreateDiskImage

func CreateDiskImage(path string, sizeGB uint64) error

CreateDiskImage creates a sparse disk image of the given size in gigabytes.

func CreateNVMeDeviceWithAttachment added in v0.6.11

func CreateNVMeDeviceWithAttachment(attachment vz.VZStorageDeviceAttachment) (vz.VZNVMExpressControllerDeviceConfiguration, error)

CreateNVMeDeviceWithAttachment creates an NVMe storage device configuration.

func CreateSerialConsole

func CreateSerialConsole(readFd, writeFd int) (vz.VZVirtioConsoleDeviceSerialPortConfiguration, error)

CreateSerialConsole creates a serial console wired to readFd and writeFd.

func CreateStdioSerialConsole

func CreateStdioSerialConsole() (vz.VZVirtioConsoleDeviceSerialPortConfiguration, error)

CreateStdioSerialConsole creates a serial console connected to stdin/stdout.

func CreateUSBMassStorageDeviceWithAttachment added in v0.6.11

func CreateUSBMassStorageDeviceWithAttachment(attachment vz.VZStorageDeviceAttachment) (vz.VZUSBMassStorageDeviceConfiguration, error)

CreateUSBMassStorageDeviceWithAttachment creates a USB mass-storage device configuration.

func DiskImageModes added in v0.6.11

func EnsureUSBController added in v0.6.11

func EnsureUSBController(config vz.VZVirtualMachineConfiguration)

EnsureUSBController adds a default XHCI controller when none is configured.

func NSDataFromBytes

func NSDataFromBytes(data []byte) foundation.NSData

NSDataFromBytes copies Go bytes into a new NSData object.

func NSDataToBytes

func NSDataToBytes(data foundation.NSData) []byte

NSDataToBytes copies bytes from an NSData object into a Go slice.

func NewDiskImageAttachment added in v0.6.11

func NewDiskImageAttachment(url foundation.INSURL, readOnly bool, policy CachePolicy) (vz.VZDiskImageStorageDeviceAttachment, error)

func NewDiskImageAttachmentWithSynchronizationMode added in v0.6.11

func NewDiskImageAttachmentWithSynchronizationMode(url foundation.INSURL, readOnly bool, caching vz.VZDiskImageCachingMode, sync vz.VZDiskImageSynchronizationMode) (vz.VZDiskImageStorageDeviceAttachment, error)

Types

type CachePolicy added in v0.6.11

type CachePolicy int
const (
	CacheDurable CachePolicy = iota
	CacheEphemeral
	CacheReadOnly
)

Jump to

Keyboard shortcuts

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