[libvirt-php] libvirt_list_storagepools() gives an error if all the storage pools on the host node are active

Fernando Casas Schössow casasfernando at outlook.com
Thu Apr 23 21:02:01 UTC 2020


Hi,

While using the function libvirt_list_storagepools() I found that if 
all the storage pools on the host node are active, the function doesn't 
return the list of storage pools but it gives the following error 
instead:

names in virConnectListDefinedStoragePools must not be NULL

Expected result, return an array of all the storage pools names on the 
host node regardless of their status (active or inactive).

virsh output for the equivalent command:

$ virsh pool-list --all

 Name State Autostart
--------------------------------------------
 default active yes
 resources active yes
 templates active yes
 virtual_machines_hdd active yes
 virtual_machines_ssd active yes


Also in the same scenario (all storage pools active) 
libvirt_list_inactive_storagepools() gives the same error detailed 
above. I wouldn't say this is actually wrong but wouldn't it be better 
if these functions returns FALSE instead if there are no results (-no 
inactive storage pools in this case-)?

System information:

OS: Debian Buster
PHP version (fast cgi): 7.3.14
Libvirt PHP version: latest from git repository @ gitlab
Libvirt version: 5.0.0

KVM host libvirt version: 5.9.0

Thanks,

Fernando





More information about the libvir-list mailing list