snapshot

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package snapshot provides VM state snapshot helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles VM state snapshot operations.

func NewManager

func NewManager(vmDir string) *Manager

NewManager creates a snapshot manager for vmDir.

func (*Manager) Delete

func (m *Manager) Delete(name string) error

Delete removes a named snapshot.

func (*Manager) List

func (m *Manager) List() ([]Meta, error)

List returns all available snapshots sorted by creation time.

func (*Manager) Restore

func (m *Manager) Restore(machine vz.VZVirtualMachine, queue *vm.Queue, name string) error

Restore restores a VM from a previously saved snapshot.

func (*Manager) Save

func (m *Manager) Save(machine vz.VZVirtualMachine, queue *vm.Queue, name string) error

Save saves the current VM state to a named snapshot.

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.

Jump to

Keyboard shortcuts

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