Defined struct and first function for enhanced snapshot handling

pull/7780/head
Thomas Meckel 7 years ago committed by Thomas Meckel
parent d3202497ae
commit a6074894f1

@ -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)

@ -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
}
Loading…
Cancel
Save