예제 #1
0
// Free releases the storage volume handle. The underlying storage volume
// continues to exist.
func (vol StorageVolume) Free() error {
	vol.log.Println("freeing storage volume object...")
	cRet := C.virStorageVolFree(vol.virStorageVol)
	ret := int32(cRet)

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

	vol.log.Println("volume freed")

	return nil
}
예제 #2
0
func (v *VirStorageVol) Free() error {
	if result := C.virStorageVolFree(v.ptr); result != 0 {
		return GetLastError()
	}
	return nil
}