]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: capabilities: use full path for emulator master
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Fri, 31 Jul 2026 15:53:56 +0000 (17:53 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 3 Aug 2026 08:37:32 +0000 (10:37 +0200)
Currently, when the bhyve driver builds capabilities, it uses
just "bhyve" as emulator path. That leads to issues, e.g.
virt-manager uses this value to fill domain's emulator field,
which has to be an absolute path. So that results in a domain
XML that fails validation.

Fix by trying to find "bhyve" in PATH and falling back to
"/usr/sbin/bhyve".

Closes: https://gitlab.com/libvirt/libvirt/-/work_items/899
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/bhyve/bhyve_capabilities.c

index 1fe0a3ad77cb5fc3b482ec17e0a84a1715fd804b..85988a2ce81dbb99a7c299bc6512095f1b424c84 100644 (file)
@@ -48,13 +48,14 @@ virBhyveCapsBuild(void)
     virCaps *caps;
     virCapsGuest *guest;
     virArch hostarch = virArchFromHost();
+    g_autofree char *binary = virFindFileInPath("bhyve");
 
     if ((caps = virCapabilitiesNew(hostarch,
                                    false, false)) == NULL)
         return NULL;
 
     guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
-                                    hostarch, "bhyve",
+                                    hostarch, binary ? binary : "/usr/sbin/bhyve",
                                     NULL, 0, NULL);
 
     virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_BHYVE,