I've tried to communicate with the guest agent on a qemu instance through the libvirt golang API. However, it always reject my connections with
2022-12-02T00:10:43.799+0100 DPANIC test/main.go:335 Failed to connect to guest {"error": "virError(Code=86, Domain=10, Message='Guest agent is not responding: QEMU guest agent is not connected')"}
Even if the qemu instance is fully booted and the guest agent is available through the commandline
sudo virsh qemu-agent-command test-vm '{"execute":"guest-info"}'
Is this a bug in the implementation or do I have to register the agent somewhere in the go code? I wasn't able to find references in the documentation.
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-6-test-vm/org.qemu.guest_agent.0'/>
<target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
Thanks!