// Free frees the domain snapshot object. The snapshot itself is not modified. // The data structure is freed and should not be used thereafter. func (snap Snapshot) Free() error { snap.log.Println("freeing snapshot object...") cRet := C.virDomainSnapshotFree(snap.virSnapshot) ret := int32(cRet) if ret == -1 { err := LastError() snap.log.Printf("an error occurred: %v\n", err) return err } snap.log.Println("snapshot freed") return nil }
func (s *VirDomainSnapshot) Free() error { if result := C.virDomainSnapshotFree(s.ptr); result != 0 { return errors.New(GetLastError()) } return nil }