[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [libvirt-php] About the inconsistency in libvirt-php



Hi all:

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.

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),
and sometimes use term "inactive" (libvirt_get_inactive_domain_count)  in contrast to "active". Which would be better?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]