<div dir="ltr">Thanks Michal, php version I used.<div><br></div><div>        $xml = new SimpleXMLElement($lv->domain_get_xml($res)) ;<br>        $data = $xml->xpath('//channel/target[@name="org.qemu.guest_agent.0"]/@state') ;<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 26, 2022 at 8:21 AM Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/25/22 20:04, Simon Fairweather wrote:<br>
> Should there be a way to suppress errors using the flags?<br>
> <br>
>  error : qemuDomainAgentAvailable:8411 : Guest agent is not responding:<br>
> QEMU guest agent is not connected<br>
> <br>
> <br>
> Or is there a libvirt function to check connection status or another way?<br>
<br>
This error message is "harmless" in a sense that there is no split brain<br>
of states between libvirt and QEMU. But yeah, your API is going to fail.<br>
<br>
You can check for the agent status in the domain XML, for instance with<br>
the following (rewrite in your favorite language):<br>
<br>
virsh dumpxml fedora | xpath -e "string(//channel/target[@name='org.qemu.guest_agent.0']/@state)"<br>
<br>
Michal<br>
<br>
</blockquote></div>