Defined struct and first function for enhanced snapshot handling

This commit is contained in:
Thomas Meckel 2019-03-16 14:59:36 +01:00 committed by Thomas Meckel
parent d3202497ae
commit a6074894f1
3 changed files with 21 additions and 0 deletions

View File

@ -241,6 +241,11 @@ func (d *VBox42Driver) Version() (string, error) {
return matches[0][1], nil 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 { func (d *VBox42Driver) CreateSnapshot(vmname string, snapshotName string) error {
log.Printf("Executing CreateSnapshot: VM: %s, SnapshotName %s", vmname, snapshotName) log.Printf("Executing CreateSnapshot: VM: %s, SnapshotName %s", vmname, snapshotName)

View File

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

View File

@ -0,0 +1 @@
package common