function get_storagepool_info($name) { if (!($res = $this->get_storagepool_res($name))) { return false; } $path = libvirt_storagepool_get_xml_desc($res, '/pool/target/path'); if (!$path) { return $this->_set_last_error(); } $perms = libvirt_storagepool_get_xml_desc($res, '/pool/target/permissions/mode'); if (!$perms) { return $this->_set_last_error(); } $otmp1 = libvirt_storagepool_get_xml_desc($res, '/pool/target/permissions/owner'); if (!is_string($otmp1)) { return $this->_set_last_error(); } $otmp2 = libvirt_storagepool_get_xml_desc($res, '/pool/target/permissions/group'); if (!is_string($otmp2)) { return $this->_set_last_error(); } $tmp = libvirt_storagepool_get_info($res); $tmp['volume_count'] = sizeof(libvirt_storagepool_list_volumes($res)); $tmp['active'] = libvirt_storagepool_is_active($res); $tmp['path'] = $path; $tmp['permissions'] = $perms; $tmp['id_user'] = $otmp1; $tmp['id_group'] = $otmp2; return $tmp; }
function ace_kvm_get_storage_info() { global $host_conn; $storage_info = array(); //$storagepools_array = ace_kvm_get_storagepool_list(); //foreach ($storagepools_array as $storagepool_name) { $storagepool_res = libvirt_storagepool_lookup_by_name($host_conn, _IMAGE_POOL_); ace_kvm_log_last_error(); $storage_info = libvirt_storagepool_get_info($storagepool_res); ace_kvm_log_last_error(); //} return $storage_info; }