Example #1
0
func (s *VirDomainSnapshot) Delete(flags uint32) error {
	result := C.virDomainSnapshotDelete(s.ptr, C.uint(flags))
	if result != 0 {
		return GetLastError()
	}
	return nil
}
Example #2
0
// Delete deletes the snapshot.
func (snap Snapshot) Delete(flags SnapshotDeleteFlag) error {
	snap.log.Printf("deleting snapshot (flags = %v)...\n", flags)
	cRet := C.virDomainSnapshotDelete(snap.virSnapshot, C.uint(flags))
	ret := int32(cRet)

	if ret == -1 {
		err := LastError()
		snap.log.Printf("an error occurred: %v\n", err)
		return err
	}

	snap.log.Println("snapshot deleted")

	return nil
}