libvirt_list_domains List all domains
&reftitle.description; array libvirt_list_domains resource connection

This function returns array of domain resources for all domains defined and/or running on the hypervisor.

&reftitle.parameters;

connection

  Connection resource of hypervisor.

&reftitle.returnvalues;

Array of domain resources for all domains. &false; on failure

&reftitle.examples;

`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/>");
    	}

    ?>

&example.outputs.similar;

    Name:   test1
    Name:   node5
    Name:   ovirt-appliance
    Name:   node3
    Name:   node4

&reftitle.seealso;

- `libvirt_list_active_domains`
- `libvirt_list_defined_domains`