[PATCH] bhyve: capabilities: use full path for emulator

Roman Bogorodskiy posted 1 patch 4 days, 5 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20260731155356.58841-1-bogorodskiy@gmail.com
src/bhyve/bhyve_capabilities.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] bhyve: capabilities: use full path for emulator
Posted by Roman Bogorodskiy 4 days, 5 hours ago
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
Re: [PATCH] bhyve: capabilities: use full path for emulator
Posted by Daniel P. Berrangé via Devel 4 days, 5 hours ago
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 :|

Re: [PATCH] bhyve: capabilities: use full path for emulator
Posted by Roman Bogorodskiy 4 days, 5 hours ago
  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?
Re: [PATCH] bhyve: capabilities: use full path for emulator
Posted by Jiri Denemark via Devel 1 day, 12 hours ago
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