Page MenuHomeFreeBSD

bhyveload: support guest rebooting from the loader
ClosedPublic

Authored by kevans on Jan 4 2024, 2:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 14, 10:03 PM
Unknown Object (File)
Thu, Nov 13, 9:44 PM
Unknown Object (File)
Thu, Nov 13, 1:40 PM
Unknown Object (File)
Mon, Nov 10, 10:23 AM
Unknown Object (File)
Nov 5 2025, 3:55 AM
Unknown Object (File)
Nov 4 2025, 1:16 PM
Unknown Object (File)
Oct 29 2025, 9:48 AM
Unknown Object (File)
Oct 15 2025, 2:02 AM
Subscribers

Details

Summary

userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader
command is executed. Use that and longjmp back to reinit the VM
entirely with a reboot request. This fixes the 'reboot' option in the
loader menu to actually reboot rather than shutdown the VM.

The JMP_* constants are introduced to keep track of why we're doing a
longjmp, though they aren't currently used. We'll notably still do a
complete reload of the interpreter to give the rebooted VM that new
loader smell. It just seemed forward thinking to just keep track of the
different setjmp points.

While we're here, we don't actually need to keep the fd we passed to
fdlopen(3), so let's avoid leaking it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable