Skip to content

examples: Check for domain status properly

In the index.php a list of VMs is printed and if the domain is alive it's screenshot is taken and placed next to its name. However, the aliveness check is written poorly. Firstly, it's accessing $dom as if it were an associative array (which is not, it's an resource), secondly it's assuming only VIR_DOMAIN_RUNNING domains can have a screenshot taken. Switch to domain_is_active() which is what libvirt does too under the hood.

Signed-off-by: Michal Privoznik mprivozn@redhat.com

Merge request reports