Bug 292686 - bhyve fails to build with WITH_BHYVE_SNAPSHOT=yes on arm64
Summary: bhyve fails to build with WITH_BHYVE_SNAPSHOT=yes on arm64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bhyve (show other bugs)
Version: 16.0-CURRENT
Hardware: arm Any
: --- Affects Only Me
Assignee: Roman Bogorodskiy
URL:
Keywords:
Depends on:
Blocks: 289848
  Show dependency tree / graph
 
Reported: 2026-01-24 07:26 UTC by Roman Bogorodskiy
Modified: 2026-01-31 16:52 UTC (History)
3 users (show)

See Also:
novel: mfc-stable15+
novel: mfc-stable14+
novel: mfc-stable13+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Bogorodskiy freebsd_committer freebsd_triage 2026-01-24 07:26:16 UTC
With WITH_BHYVE_SNAPSHOT=yes in /etc/src.conf bhyve fails to build on arm64 with the following error:

--- bhyverun.pieo ---
In file included from /mnt/data/aarch64/freebsd-src/usr.sbin/bhyve/bhyverun.c:94:
/mnt/data/aarch64/freebsd-src/usr.sbin/bhyve/snapshot.h:79:20: error: field has incomplete type 'enum snapshot_req'
   79 |         enum snapshot_req req;          /* request type */ 
      |                           ^                
/mnt/data/aarch64/freebsd-src/usr.sbin/bhyve/snapshot.h:79:7: note: forward declaration of 'enum snapshot_req'
   79 |         enum snapshot_req req;          /* request type */ 
      |              ^
--- all_subdir_lib ---
--- atof.3.gz ---
--- all_subdir_usr.sbin ---
1 error generated.
Comment 1 Simon Wollwage freebsd_triage 2026-01-24 12:09:33 UTC
src.conf(5):

     WITH_BHYVE_SNAPSHOT
             Include support for save and restore (snapshots) in bhyve(8) and
             bhyvectl(8).

             This option only affects amd64/amd64.

From your logs it looks like you are trying to compile on aarch64
Comment 2 Roman Bogorodskiy freebsd_committer freebsd_triage 2026-01-24 13:11:42 UTC
(In reply to Simon Wollwage from comment #1)

> This option only affects amd64/amd64.

Does it mean it should fail buildworld like that on other arches?

> From your logs it looks like you are trying to compile on aarch64

Yes, the bug title does mention that.
Comment 3 Simon Wollwage freebsd_triage 2026-01-24 15:03:57 UTC
(In reply to Roman Bogorodskiy from comment #2)

Not sure how that case should be handled. On aarch64, the header is empty. Should it provide an empty enum and empty stubs for the functions? 

If the feature isn't supported, it shouldn't build with the feature enabled. Otherwise it would be a misleading flag, wouldn't it? You can't enable snapshots and build it and then have no snapshot functionality.

Not an opinion, just trying to troubleshoot.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2026-01-26 16:18:31 UTC
We can make BHYVE_SNAPSHOT a BROKEN_OPTIONS in share/mk/src.opts.mk until this is resolved, which might help make the situation more clear. That said, we really need to add support for non-x86 archs.
Comment 5 mgrooms 2026-01-26 18:19:01 UTC
Perhaps the FreeBSD Foundation can allocate resources to help review and potentially support the work being done here ...

https://reviews.freebsd.org/D51555

It's my understanding that Hans Rosenfeld is attempting to backport a subset of patches from IllumOS to FreeBSD bhyve related to snapshot and migration support. The bhyve code in IllumOS has matured far past FreeBSD in this regard. His stated goals here are to reduce differences between the two platforms, mature the feature set and potentially make them interoperate ( ie. support migration between the IllumOS & FreeBSD ).

The CPUID feature work referenced above is foundational to solving issues relate to the snapshot and migration features that IllumOS has already sorted. Unfortunately it seems that his work is stalled waiting on review.

For more info, please see his presentation at bhyvecon 2025 ...

https://www.youtube.com/watch?v=DPafGgfWaJU&list=PLkIW-zZY-vLHwsS6R87yDp9DDtvAF9tfN&index=10


The bhyve hypervisor tech really needs to be pushed forward. Not much runs on physical hardware these days. What does is mostly to support virtualized guest work. When very capable folks like Hans step up to do heavy lifting, I hate to see it die on the vine.
Comment 6 mgrooms 2026-01-26 18:24:15 UTC
Sorry. I meant to share a link that jumped forward to his stated goals ...

https://youtu.be/DPafGgfWaJU?si=hYxhKLXRQYgnnCKV&t=843
Comment 7 Ed Maste freebsd_committer freebsd_triage 2026-01-26 19:17:33 UTC
(In reply to mgrooms from comment #5)
Hans' work is sponsored by the Foundation
Comment 8 mgrooms 2026-01-26 19:32:57 UTC
Amazing news. Thank you.
Comment 9 commit-hook freebsd_committer freebsd_triage 2026-01-27 17:00:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b01763b2b2ab2d87f7d3c6ae57783c731ce548dd

commit b01763b2b2ab2d87f7d3c6ae57783c731ce548dd
Author:     Roman Bogorodskiy <novel@FreeBSD.org>
AuthorDate: 2026-01-26 18:24:15 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2026-01-27 16:55:17 +0000

    bhyve: make BHYVE_SNAPSHOT amd64-only

    Build fails with BHYVE_SNAPSHOT enabled on non-amd64,
    so add it to BROKEN_OPTIONS for these arches.

    PR:                     292686
    Reviewed by:            emaste, markj
    MFC after:              3 days
    Sponsored by:           The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D54873

 share/mk/src.opts.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-01-31 13:24:28 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=50b0a2002c15a9961e7ff78369dcb012dc52fcb1

commit 50b0a2002c15a9961e7ff78369dcb012dc52fcb1
Author:     Roman Bogorodskiy <novel@FreeBSD.org>
AuthorDate: 2026-01-26 18:24:15 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2026-01-31 11:56:12 +0000

    bhyve: make BHYVE_SNAPSHOT amd64-only

    Build fails with BHYVE_SNAPSHOT enabled on non-amd64,
    so add it to BROKEN_OPTIONS for these arches.

    PR:                     292686
    Reviewed by:            emaste, markj
    MFC after:              3 days
    Sponsored by:           The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D54873

    (cherry picked from commit b01763b2b2ab2d87f7d3c6ae57783c731ce548dd)

 share/mk/src.opts.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-01-31 15:11:49 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=139f620c0c9056ddec81fce3738396b145bd69b7

commit 139f620c0c9056ddec81fce3738396b145bd69b7
Author:     Roman Bogorodskiy <novel@FreeBSD.org>
AuthorDate: 2026-01-26 18:24:15 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2026-01-31 13:24:33 +0000

    bhyve: make BHYVE_SNAPSHOT amd64-only

    Build fails with BHYVE_SNAPSHOT enabled on non-amd64,
    so add it to BROKEN_OPTIONS for these arches.

    PR:                     292686
    Reviewed by:            emaste, markj
    MFC after:              3 days
    Sponsored by:           The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D54873

    (cherry picked from commit b01763b2b2ab2d87f7d3c6ae57783c731ce548dd)

 share/mk/src.opts.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2026-01-31 16:51:06 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bffa54b58cbfc41e0502b97065726dc3fbaea6c7

commit bffa54b58cbfc41e0502b97065726dc3fbaea6c7
Author:     Roman Bogorodskiy <novel@FreeBSD.org>
AuthorDate: 2026-01-26 18:24:15 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2026-01-31 15:43:55 +0000

    bhyve: make BHYVE_SNAPSHOT amd64-only

    Build fails with BHYVE_SNAPSHOT enabled on non-amd64,
    so add it to BROKEN_OPTIONS for these arches.

    PR:                     292686
    Reviewed by:            emaste, markj
    MFC after:              3 days
    Sponsored by:           The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D54873

    (cherry picked from commit b01763b2b2ab2d87f7d3c6ae57783c731ce548dd)

 share/mk/src.opts.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 13 Roman Bogorodskiy freebsd_committer freebsd_triage 2026-01-31 16:52:55 UTC
Closing this one. I guess it'd make sense to track snapshot development for arm64 separately.