(php-libvirt 0.1)
libvirt_list_domains — List all domains
This function returns array of domain resources for all domains defined and/or running on the hypervisor.
Connection resource of hypervisor.
Array of domain resources for all domains. FALSE on failure
Example #1 libvirt_list_domains() example
List all domains and get their names
<?php
$conn=libvirt_connect($uri,true);
$domains=libvirt_list_domains($conn);
foreach ($domains as $dom)
{
echo ("Name:\t".libvirt_domain_get_name($dom)."<br/>");
}
?>
The above example will output something similar to:
Name: test1 Name: node5 Name: ovirt-appliance Name: node3 Name: node4