]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyve: fix bhyveConnectAgent() master
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 14 Jun 2026 05:58:10 +0000 (07:58 +0200)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 15 Jun 2026 16:48:52 +0000 (18:48 +0200)
commit99e04f1ac063bd1c62f8477a05a07f1883203475
tree968eceda9ea690d65bec273f9f36195e0a28bc18
parentc675146d139cdc31825266d98753e49c472a2c56
bhyve: fix bhyveConnectAgent()

The bhyveConnectAgent() function calls qemuAgentOpen() to open an agent
connection. If it fails, e.g. because of insufficient permissions to
open the socket, it returns NULL. Currently, if that happens,
bhyveConnectAgent() just sets agentError to true and exits with 0.
This does not match the contract of bhyveDomainEnsureAgent(), which
should either provide an agent connection or fail.

Fix that by returning -1 when qemuAgentOpen() fails. To make intent
clearer, add a documentation for bhyveConnectAgent().

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/bhyve/bhyve_process.c