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>
---
src/bhyve/bhyve_capabilities.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
index 1fe0a3ad77..85988a2ce8 100644
--- a/src/bhyve/bhyve_capabilities.c
+++ b/src/bhyve/bhyve_capabilities.c
@@ -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,
--
2.52.0
On Fri, Jul 31, 2026 at 05:53:56PM +0200, Roman Bogorodskiy wrote: > 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> > --- > src/bhyve/bhyve_capabilities.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Daniel P. Berrangé wrote: > On Fri, Jul 31, 2026 at 05:53:56PM +0200, Roman Bogorodskiy wrote: > > 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> > > --- > > src/bhyve/bhyve_capabilities.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Thanks! Should I push it now or wait until after 12.6.0?
On Fri, Jul 31, 2026 at 18:12:23 +0200, Roman Bogorodskiy wrote: > Daniel P. Berrangé wrote: > > > On Fri, Jul 31, 2026 at 05:53:56PM +0200, Roman Bogorodskiy wrote: > > > 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> > > > --- > > > src/bhyve/bhyve_capabilities.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> > > Thanks! Should I push it now or wait until after 12.6.0? This is a bugfix and pretty safe so I pushed it before making the release. Thanks, Jirka
© 2016 - 2026 Red Hat, Inc.