function storagevolume_delete($path) { $vol = libvirt_storagevolume_lookup_by_path($this->conn, $path); if (!libvirt_storagevolume_delete($vol)) { return $this->_set_last_error(); } return true; }
/** * delete a volume in _IMAGE_POOL_ on the virt host * * @global resource $host_conn libvirt connection * * @param string $volume_virt_id virt_id of the volume * * @return bool TRUE on success | FALSE on error */ function ace_kvm_volume_delete($volume_virt_id) { global $host_conn; $volume_pool_name = _IMAGE_POOL_; $volume_pool_res = libvirt_storagepool_lookup_by_name($host_conn, $volume_pool_name); ace_kvm_log_last_error(); $volume_res = libvirt_storagevolume_lookup_by_name($volume_pool_res, $volume_virt_id); ace_kvm_log_last_error(); $success = libvirt_storagevolume_delete($volume_res); ace_kvm_log_last_error(); return $success; }