Skip to content

target/i386/bhyve: fix FreeBSD build - correct include paths and meson build system#2

Open
cardozQ wants to merge 2 commits into
dumrich:accel-vmmfrom
cardozQ:accel-vmm
Open

target/i386/bhyve: fix FreeBSD build - correct include paths and meson build system#2
cardozQ wants to merge 2 commits into
dumrich:accel-vmmfrom
cardozQ:accel-vmm

Conversation

@cardozQ
Copy link
Copy Markdown

@cardozQ cardozQ commented Mar 16, 2026

Summary

Fix two build failures in the bhyve accelerator that prevent
compiling on FreeBSD with recent QEMU versions.

Changes

1. Fix include paths for hw/core headers

Headers boards.h, irq.h, and qdev-properties.h were
relocated to hw/core/ in recent QEMU versions. The bhyve
source files were still referencing the old paths, causing
fatal build errors.

Files changed:

  • target/i386/bhyve/bhyve-all.c: hw/boards.hhw/core/boards.h
  • target/i386/bhyve/bhyve-i8259.c: hw/irq.hhw/core/irq.h
  • target/i386/bhyve/bhyve-ioapic.c: hw/qdev-properties.hhw/core/qdev-properties.h

2. Fix meson.build missing include_directories

The bhyve meson.build had no include_directories configured,
so QEMU's internal headers were not visible to the bhyve source
files during compilation. Added a declare_dependency with the
correct relative paths to the QEMU source and include trees.

Also removed stale hardcoded absolute paths from the original
developer's local machine (/home/chabi/freebsd-src/...) that
were left behind as commented-out dead code.

Build errors fixed

fatal error: 'hw/boards.h' file not found
fatal error: 'hw/irq.h' file not found  
fatal error: 'hw/qdev-properties.h' file not found

Tested on

  • FreeBSD 15-CURRENT (x86_64)
  • Clang 19.1.7
  • QEMU 10.2.50
  • Build target: x86_64-softmmu
  • Accelerator confirmed working: bhyve

Notes

After these fixes, the fork builds successfully and
qemu-system-x86_64 -accel help correctly lists bhyve
as an available accelerator, confirming vmm.ko integration
via libvmmapi is functional.

cardozQ added 2 commits March 16, 2026 18:33
Headers boards.h, irq.h, and qdev-properties.h were moved to
hw/core/ in recent QEMU versions. Update the bhyve source files
to use the correct paths.

Fixes build failure on FreeBSD:
  fatal error: 'hw/boards.h' file not found
  fatal error: 'hw/irq.h' file not found
  fatal error: 'hw/qdev-properties.h' file not found
Add declare_dependency with include_directories so bhyve source
files can resolve QEMU internal headers. Also remove stale
hardcoded local paths from original developer's machine
(/home/chabi/freebsd-src/...) that were left commented out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant