Documentation
¶
Overview ¶
Package snapshot provides VM state snapshot helpers, including both the public Virtualization save/restore APIs and the private save-with-options selector for compressed or encrypted state files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // _VZVirtualMachineSaveOptions class is not available on this OS. ErrSaveOptionsUnavailable = errors.New("private save options class unavailable") // ErrSaveWithOptionsUnsupported reports that the VM does not respond to // _saveMachineStateToURL:options:completionHandler:. ErrSaveWithOptionsUnsupported = errors.New("private save with options selector unavailable") )
Functions ¶
func CanSaveWithOptions ¶
func CanSaveWithOptions(machine vz.VZVirtualMachine) bool
CanSaveWithOptions reports whether machine supports saving state with private SaveOptions on this host.
func SaveMachineStateWithOptions ¶
func SaveMachineStateWithOptions(ctx context.Context, machine vz.VZVirtualMachine, queue *vm.Queue, url foundation.NSURL, opts SaveOptions) error
SaveMachineStateWithOptions saves machine state to url using the private _saveMachineStateToURL:options:completionHandler: selector.
If the private class or selector is unavailable, it returns ErrSaveOptionsUnavailable or ErrSaveWithOptionsUnsupported without hanging. If ctx expires before completion, it returns ctx.Err(); callers must not retry to the same URL or resume the VM while the save may still be running.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles VM state snapshot operations.
func NewManager ¶
NewManager creates a snapshot manager for vmDir.
type Meta ¶
type Meta struct {
Name string `json:"name"`
Created time.Time `json:"created"`
Size int64 `json:"size"`
VMState string `json:"vmState"`
FilePath string `json:"filePath"`
}
Meta is the on-disk metadata format for VM state snapshots.
type SaveOptions ¶
SaveOptions configures private VM state saving via _saveMachineStateToURL:options:completionHandler:.