func (v *VirStorageVol) Delete(flags uint32) error {
	result := C.virStorageVolDelete(v.ptr, C.uint(flags))
	if result == -1 {
		return GetLastError()
	}
	return nil
}
Exemple #2
0
func (v *VirStorageVol) Delete() error {
	//always pass 0
	result := C.virStorageVolDelete(v.ptr, 0)
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
// Delete deletes the storage volume from the pool.
func (vol StorageVolume) Delete() error {
	vol.log.Println("deleting storage volume...")
	cRet := C.virStorageVolDelete(vol.virStorageVol, 0)
	ret := int32(cRet)

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

	vol.log.Println("volume deleted")

	return nil
}