diff --git a/builder/virtualbox/common/driver_4_2.go b/builder/virtualbox/common/driver_4_2.go index fe7a6964a..0a2e5dbe5 100644 --- a/builder/virtualbox/common/driver_4_2.go +++ b/builder/virtualbox/common/driver_4_2.go @@ -241,6 +241,11 @@ func (d *VBox42Driver) Version() (string, error) { return matches[0][1], nil } +// LoadSnapshots load the snapshots for a VM instance +func (d *VBox42Driver) LoadSnapshots(vmName string) (*VBoxSnapshot, error) { + return nil, nil +} + func (d *VBox42Driver) CreateSnapshot(vmname string, snapshotName string) error { log.Printf("Executing CreateSnapshot: VM: %s, SnapshotName %s", vmname, snapshotName) diff --git a/builder/virtualbox/common/snapshot.go b/builder/virtualbox/common/snapshot.go new file mode 100644 index 000000000..c12804ed2 --- /dev/null +++ b/builder/virtualbox/common/snapshot.go @@ -0,0 +1,15 @@ +package common + +// VBoxSnapshot stores the hierarchy of snapshots for a VM instance +type VBoxSnapshot struct { + Name string + UUID string + IsCurrent bool + Parent *VBoxSnapshot // nil if topmost (root) snapshot + Children []VBoxSnapshot +} + +// IsChildOf verifies if the current snaphot is a child of the passed as argument +func (sn *VBoxSnapshot) IsChildOf(candidate *VBoxSnapshot) bool { + return false +} diff --git a/builder/virtualbox/common/snapshot_test.go b/builder/virtualbox/common/snapshot_test.go new file mode 100644 index 000000000..805d0c79a --- /dev/null +++ b/builder/virtualbox/common/snapshot_test.go @@ -0,0 +1 @@ +package common