aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Bogorodskiy <novel@FreeBSD.org>2025-12-05 17:16:29 +0000
committerRoman Bogorodskiy <novel@FreeBSD.org>2025-12-13 09:12:38 +0000
commit611bbb190ff593e0e424e311575d7e978e623659 (patch)
tree2fd01136f3c2b51020b4e739ffc7b22e15d4a84b
parentc42bce238abd9dc36113457372e62bf14690af52 (diff)
bhyve: change suspend exit code
Currently, after suspending, bhyve(8) exits with 0. This code is also used to indicate that a VM was rebooted. To differentiate reboot and suspend, use the next available exit code, 5, for suspend. Approved by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D54087
-rw-r--r--usr.sbin/bhyve/bhyve.84
-rw-r--r--usr.sbin/bhyve/snapshot.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
index 45450b5b5db5..0893b0b719bc 100644
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd October 28, 2025
+.Dd December 4, 2025
.Dt BHYVE 8
.Os
.Sh NAME
@@ -1158,6 +1158,8 @@ halted
triple fault (amd64 only)
.It 4
exited due to an error
+.It 5
+suspended
.El
.Sh EXAMPLES
If not using a boot ROM, the guest operating system must have been loaded with
diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c
index 997faa254284..eabe6ab47f80 100644
--- a/usr.sbin/bhyve/snapshot.c
+++ b/usr.sbin/bhyve/snapshot.c
@@ -1308,7 +1308,7 @@ vm_checkpoint(struct vmctx *ctx, int fddir, const char *checkpoint_file,
if (stop_vm) {
vm_destroy(ctx);
- exit(0);
+ exit(5);
}
done: