Documentation
¶
Overview ¶
Package storagehotplug provides runtime storage device management.
It is intended to wrap the private storage device APIs used to create live devices, swap attachments, resize backing media, and detach or replace disks on a running virtual machine.
The package should focus on:
Constructing live storage devices from attachments Swapping attachments with completion handlers Safe helpers for common hot-plug and hot-swap flows
This package complements the static storage configuration helpers in the parent vzkit package.
Index ¶
- func NewDiskImageAttachment(path string, readOnly bool) (pvz.VZDiskImageStorageDeviceAttachment, error)
- func SetAttachment(ctx context.Context, queue *vm.Queue, device pvz.VZStorageDevice, ...) error
- func UpdateDiskSize(attachment pvz.VZDiskImageStorageDeviceAttachment, size uint64) error
- type Device
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDiskImageAttachment ¶
func NewDiskImageAttachment(path string, readOnly bool) (pvz.VZDiskImageStorageDeviceAttachment, error)
NewDiskImageAttachment opens path as a disk image attachment.
func SetAttachment ¶
func SetAttachment(ctx context.Context, queue *vm.Queue, device pvz.VZStorageDevice, attachment pvz.VZStorageDeviceAttachment) error
SetAttachment swaps the device attachment and waits for completion.
func UpdateDiskSize ¶
func UpdateDiskSize(attachment pvz.VZDiskImageStorageDeviceAttachment, size uint64) error
UpdateDiskSize updates the size of a disk image attachment.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps a live VZStorageDevice.
func NewDevice ¶
func NewDevice(attachment pvz.VZStorageDeviceAttachment) (Device, error)
NewDevice creates a live storage device for attachment.
func NewDiskImageDevice ¶
func NewDiskImageDevice(path string, readOnly bool) (Device, pvz.VZDiskImageStorageDeviceAttachment, error)
NewDiskImageDevice opens path and creates a live storage device.
func (Device) Attachment ¶
func (d Device) Attachment() objectivec.IObject
Attachment returns the current attachment.
func (Device) Raw ¶
func (d Device) Raw() pvz.VZStorageDevice
Raw returns the underlying Objective-C wrapper.
func (Device) SetAttachment ¶
func (d Device) SetAttachment(ctx context.Context, queue *vm.Queue, attachment pvz.VZStorageDeviceAttachment) error
SetAttachment swaps the device attachment and waits for completion.
func (Device) SetVirtualMachine ¶
func (d Device) SetVirtualMachine(machine objectivec.IObject)
SetVirtualMachine associates the device with a VM.