storagehotplug

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

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

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 FromID

func FromID(id objectivec.IObject) Device

FromID wraps an existing storage device ID.

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.

Jump to

Keyboard shortcuts

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