I noticed that there's some inconsistent behaviors in libvirt-php, and wondering what's the best way to handle them.
In libvirt-php:
libvirt_list_domains() returns an array of all domain resource;
libvirt_list_active_domains() returns an array of running domain ids;
libvirt_list_defined_domains() returns an array of defined domain names.
and
libvirt_list_storagepools() returns an array of actived storagepool names.
libvirt_list_active_domains() returns an array of running domain ids;
libvirt_list_defined_domains() returns an array of defined domain names.
and
libvirt_list_storagepools() returns an array of actived storagepool names.
In my opinion, returning an array of names would be better when listing all kinds of objects.
And the naming convenances, let's take domains as an example.
libvirt-php provied
libvirt_list_domains() for all domains, which has no corresponding function in libvirt.
libvirt_list_active_domains() for running domains, corresponding to virConnectListDomains()Â in libvirt.
libvirt_list_defined_domains() for defined domains, corresponding to virConnectListDefinedDomains()Â in libvirt.
I believe it is fine. However, for defined objects, sometimes it used term "defined" (libvirt_list_defined_domains), libvirt_list_active_domains() for running domains, corresponding to virConnectListDomains()Â in libvirt.
libvirt_list_defined_domains() for defined domains, corresponding to virConnectListDefinedDomains()Â in libvirt.
and sometimes use term "inactive" (libvirt_get_inactive_domain_count)Â in contrast to "active". Which would be better?
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list