From nobody Wed Dec 17 14:08:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dWbJ950bYz6LB3d for ; Wed, 17 Dec 2025 14:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWbJ92xBZz3JqB for ; Wed, 17 Dec 2025 14:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765980537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HlHMXx8yUEU+lRPShSMCz7e1K4KJe6UDkofSzfeAml8=; b=J3/G29QU98N2PPDOig+g/6lGwE2vLXyHvVmz6syj8PxBaXRNXEIYZZI6/QQbe0+XZYJRtl JmV33lNNfKK5UQk3brDo0LnaC39QVl7NDLcna6jUMCwwmce5R4D8AaVKtYbEvoSBIUHkha NT4708tlxvxU1ybN/jO0LQKjsXXnm3ArdFOJfPxHky3mE5mUyLrtiOTKVh8dPWsJCyP/XW Aw8eFr2V6fYLJRgUBJ0+euhPowWkdjc8FlOrDz5RPRngVyNP7VIENkrak4rGfxXL5oOKlf Wzjs3zrszm0X7ZkJ1bsVjNRWiG8BaQqhVJsRElGtH7CNxhu3vq+Gp2H24UrriQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765980537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HlHMXx8yUEU+lRPShSMCz7e1K4KJe6UDkofSzfeAml8=; b=W/daIZsku9Xk5E0emEFyRLtTvSPAkFDs7ageUYG9YCO92vy+4H4cx5hMpkn55jrXjAI2jx KPaBgDuQvSyCLKim7f0DecMsyq/f1c9l4VUSF7LDf6BOBYJbvShodN9dalGLCIS6VMzNow 0yzT6tQYtWkbeb2xsmbAL6AGxIy9nebc3Ngagqu0yU+D6D2tuvtZw5vp5qtbyHjdLH7RyL X39t+3UCctsFe6uaK+brexzYAtQ6+uGNJqLj4hNCzITDbkIKywVTQcLYdtPY5o7Ces4ccW Kpnv9TngzZJ1UILusKZl345gD7uJUAuotiYHhTU5UnT0Jg/tAvVXPmKIAlJhwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765980537; a=rsa-sha256; cv=none; b=NSV3rfb7kVcCUvpKsPK7vns08NfG89iPO6HiOX28J4WfoZcw7XxPFS7LxjRrElvkxRwITd lGx8YT7Y4qPDqq0di14onzhuOBHgVmbkI65nWMIyEGLhRpGsYN8pQ1f9U39M/884SqLOAk hALd+TnJjRh3TE3Av36Ly5VkyvhHq1yGkJnwqX29uU4vekJqdkUuQ9BgAEp9XI55r+Y6yX 9oEw7szBJ1mfhREYWXnkoKPXlNwSb3DS8f4fR84pjjVAwi1OfRBtme75DouhA2Fq/alog4 SCdkYr9fA0JmW69jSTLo0K9QKFeKeU3ZcbMzQzjp4XqfDxANB4KD0zuc3pSLFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dWbJ928SZzvdw for ; Wed, 17 Dec 2025 14:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38156 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 14:08:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan Novk=?utf-8?Q?ovi=C4=87?= Subject: git: 3c0686082df8 - main - bhyve: Eliminate exit status magic numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c0686082df824ef06b739253c032ab35723e251 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 14:08:57 +0000 Message-Id: <6942b979.38156.5811bb07@gitrepo.freebsd.org> The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=3c0686082df824ef06b739253c032ab35723e251 commit 3c0686082df824ef06b739253c032ab35723e251 Author: Bojan Novković AuthorDate: 2025-11-06 14:28:24 +0000 Commit: Bojan Novković CommitDate: 2025-12-17 14:08:32 +0000 bhyve: Eliminate exit status magic numbers bhyve's exit status codes indicate how the VM was terminated. Unfortunately, their meaning within the source code is somewhat unclear since they are only used as magic numbers. Fix this by defining exit status macros and using them to replace the magic numbers in exit(3) function calls. Differential Revision: https://reviews.freebsd.org/D53730 Reviewed by: markj, corvink, emaste Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. MFC after: 3 months --- usr.sbin/bhyve/aarch64/bhyverun_machdep.c | 2 +- usr.sbin/bhyve/aarch64/vmexit.c | 8 +++--- usr.sbin/bhyve/amd64/bhyverun_machdep.c | 8 +++--- usr.sbin/bhyve/amd64/fwctl.c | 2 +- usr.sbin/bhyve/amd64/vmexit.c | 10 +++---- usr.sbin/bhyve/bhyverun.c | 46 +++++++++++++++---------------- usr.sbin/bhyve/bhyverun.h | 10 +++++++ usr.sbin/bhyve/gdb.c | 2 +- usr.sbin/bhyve/mevent.c | 3 +- usr.sbin/bhyve/mevent_test.c | 9 +++--- usr.sbin/bhyve/riscv/bhyverun_machdep.c | 2 +- usr.sbin/bhyve/riscv/vmexit.c | 8 +++--- usr.sbin/bhyve/snapshot.c | 2 +- 13 files changed, 62 insertions(+), 50 deletions(-) diff --git a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c index 06fe85f96e0a..1d35f958ffb7 100644 --- a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c +++ b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c @@ -168,7 +168,7 @@ bhyve_optparse(int argc, char **argv) pci_print_supported_devices(); exit(0); } else if (pci_parse_slot(optarg) != 0) - exit(4); + exit(BHYVE_EXIT_ERROR); else break; case 'S': diff --git a/usr.sbin/bhyve/aarch64/vmexit.c b/usr.sbin/bhyve/aarch64/vmexit.c index 2457cbe76b5e..cab3125b9c52 100644 --- a/usr.sbin/bhyve/aarch64/vmexit.c +++ b/usr.sbin/bhyve/aarch64/vmexit.c @@ -115,15 +115,15 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) switch (how) { case VM_SUSPEND_RESET: - exit(0); + exit(BHYVE_EXIT_RESET); case VM_SUSPEND_POWEROFF: if (get_config_bool_default("destroy_on_poweroff", false)) vm_destroy(ctx); - exit(1); + exit(BHYVE_EXIT_POWEROFF); case VM_SUSPEND_HALT: - exit(2); + exit(BHYVE_EXIT_HALT); case VM_SUSPEND_DESTROY: - exit(4); + exit(BHYVE_EXIT_ERROR); default: fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); exit(100); diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c index dad8f1e52e4e..4fd3c29bd86a 100644 --- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c +++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c @@ -186,7 +186,7 @@ bhyve_optparse(int argc, char **argv) pci_print_supported_devices(); exit(0); } else if (pci_parse_slot(optarg) != 0) - exit(4); + exit(BHYVE_EXIT_ERROR); else break; case 'S': @@ -276,7 +276,7 @@ bhyve_init_vcpu(struct vcpu *vcpu) err = vm_get_capability(vcpu, VM_CAP_HALT_EXIT, &tmp); if (err < 0) { EPRINTLN("VM exit on HLT not supported"); - exit(4); + exit(BHYVE_EXIT_ERROR); } vm_set_capability(vcpu, VM_CAP_HALT_EXIT, 1); } @@ -288,7 +288,7 @@ bhyve_init_vcpu(struct vcpu *vcpu) err = vm_get_capability(vcpu, VM_CAP_PAUSE_EXIT, &tmp); if (err < 0) { EPRINTLN("SMP mux requested, no pause support"); - exit(4); + exit(BHYVE_EXIT_ERROR); } vm_set_capability(vcpu, VM_CAP_PAUSE_EXIT, 1); } @@ -300,7 +300,7 @@ bhyve_init_vcpu(struct vcpu *vcpu) if (err) { EPRINTLN("Unable to set x2apic state (%d)", err); - exit(4); + exit(BHYVE_EXIT_ERROR); } vm_set_capability(vcpu, VM_CAP_ENABLE_INVPCID, 1); diff --git a/usr.sbin/bhyve/amd64/fwctl.c b/usr.sbin/bhyve/amd64/fwctl.c index 76e2eaf67849..730a76382996 100644 --- a/usr.sbin/bhyve/amd64/fwctl.c +++ b/usr.sbin/bhyve/amd64/fwctl.c @@ -368,7 +368,7 @@ fwctl_request(uint32_t value) /* Verify size */ if (value < 12) { printf("msg size error"); - exit(4); + exit(BHYVE_EXIT_ERROR); } rinfo.req_size = value; rinfo.req_count = 1; diff --git a/usr.sbin/bhyve/amd64/vmexit.c b/usr.sbin/bhyve/amd64/vmexit.c index 14f89563fd0f..fb64f9bbe1a8 100644 --- a/usr.sbin/bhyve/amd64/vmexit.c +++ b/usr.sbin/bhyve/amd64/vmexit.c @@ -409,17 +409,17 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) switch (how) { case VM_SUSPEND_RESET: - exit(0); + exit(BHYVE_EXIT_RESET); case VM_SUSPEND_POWEROFF: if (get_config_bool_default("destroy_on_poweroff", false)) vm_destroy(ctx); - exit(1); + exit(BHYVE_EXIT_POWEROFF); case VM_SUSPEND_HALT: - exit(2); + exit(BHYVE_EXIT_HALT); case VM_SUSPEND_TRIPLEFAULT: - exit(3); + exit(BHYVE_EXIT_TRIPLEFAULT); case VM_SUSPEND_DESTROY: - exit(4); + exit(BHYVE_EXIT_ERROR); default: EPRINTLN("vmexit_suspend: invalid reason %d", how); exit(100); diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index bfc0b949a75d..6190e0039c9d 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -477,7 +477,7 @@ set_vcpu_affinities(void) value = get_config_value_node(nvl, "cpus"); if (value == NULL) { EPRINTLN("Missing CPU set for domain %d", dom); - exit(4); + exit(BHYVE_EXIT_ERROR); } parse_cpuset(dom, value, &cpus); @@ -487,7 +487,7 @@ set_vcpu_affinities(void) EPRINTLN( "Unable to set vCPU %d affinity for domain %d: %s", cpu, dom, strerror(errno)); - exit(4); + exit(BHYVE_EXIT_ERROR); } } } @@ -504,7 +504,7 @@ set_vcpu_affinities(void) EPRINTLN( "Unable to set vCPU %d affinity for domain %d: %s", cpu, 0, strerror(errno)); - exit(4); + exit(BHYVE_EXIT_ERROR); } } } @@ -562,7 +562,7 @@ fbsdrun_start_thread(void *param) vm_loop(vi->ctx, vi->vcpu); /* We get here if the VM was destroyed asynchronously. */ - exit(4); + exit(BHYVE_EXIT_ERROR); } void @@ -596,7 +596,7 @@ fbsdrun_deletecpu(int vcpu) pthread_mutex_lock(&resetcpu_mtx); if (!CPU_ISSET(vcpu, &cpumask)) { EPRINTLN("Attempting to delete unknown cpu %d", vcpu); - exit(4); + exit(BHYVE_EXIT_ERROR); } CPU_CLR(vcpu, &cpumask); @@ -645,7 +645,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu) if (exitcode >= VM_EXITCODE_MAX || vmexit_handlers[exitcode] == NULL) { warnx("vm_loop: unexpected exitcode 0x%x", exitcode); - exit(4); + exit(BHYVE_EXIT_ERROR); } rc = (*vmexit_handlers[exitcode])(ctx, vcpu, &vmrun); @@ -656,7 +656,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu) case VMEXIT_ABORT: abort(); default: - exit(4); + exit(BHYVE_EXIT_ERROR); } } EPRINTLN("vm_run error %d, errno %d", error, errno); @@ -816,7 +816,7 @@ main(int argc, char *argv[]) if (error) { fprintf(stderr, "Failed to read checkpoint info from " "file: '%s'.\n", restore_file); - exit(1); + exit(BHYVE_EXIT_ERROR); } vmname = lookup_vmname(&rstate); if (vmname != NULL) @@ -833,7 +833,7 @@ main(int argc, char *argv[]) if (get_config_bool_default("config.dump", false)) { dump_config(); - exit(1); + exit(BHYVE_EXIT_POWEROFF); } calc_topology(); @@ -855,7 +855,7 @@ main(int argc, char *argv[]) if (guest_ncpus < 1) { fprintf(stderr, "Invalid guest vCPUs (%d)\n", guest_ncpus); - exit(1); + exit(BHYVE_EXIT_ERROR); } #endif @@ -864,7 +864,7 @@ main(int argc, char *argv[]) if (guest_ncpus > max_vcpus) { fprintf(stderr, "%d vCPUs requested but only %d available\n", guest_ncpus, max_vcpus); - exit(4); + exit(BHYVE_EXIT_ERROR); } bhyve_init_vcpu(bsp); @@ -898,17 +898,17 @@ main(int argc, char *argv[]) init_mem(guest_ncpus); init_bootrom(ctx); if (bhyve_init_platform(ctx, bsp) != 0) - exit(4); + exit(BHYVE_EXIT_ERROR); if (qemu_fwcfg_init(ctx) != 0) { fprintf(stderr, "qemu fwcfg initialization error\n"); - exit(4); + exit(BHYVE_EXIT_ERROR); } if (qemu_fwcfg_add_file("opt/bhyve/hw.ncpu", sizeof(guest_ncpus), &guest_ncpus) != 0) { fprintf(stderr, "Could not add qemu fwcfg opt/bhyve/hw.ncpu\n"); - exit(4); + exit(BHYVE_EXIT_ERROR); } /* @@ -917,11 +917,11 @@ main(int argc, char *argv[]) if (init_pci(ctx) != 0) { EPRINTLN("Device emulation initialization error: %s", strerror(errno)); - exit(4); + exit(BHYVE_EXIT_ERROR); } if (init_tpm(ctx) != 0) { EPRINTLN("Failed to init TPM device"); - exit(4); + exit(BHYVE_EXIT_ERROR); } /* @@ -946,37 +946,37 @@ main(int argc, char *argv[]) FPRINTLN(stdout, "Pausing pci devs..."); if (vm_pause_devices() != 0) { EPRINTLN("Failed to pause PCI device state."); - exit(1); + exit(BHYVE_EXIT_ERROR); } FPRINTLN(stdout, "Restoring vm mem..."); if (restore_vm_mem(ctx, &rstate) != 0) { EPRINTLN("Failed to restore VM memory."); - exit(1); + exit(BHYVE_EXIT_ERROR); } FPRINTLN(stdout, "Restoring pci devs..."); if (vm_restore_devices(&rstate) != 0) { EPRINTLN("Failed to restore PCI device state."); - exit(1); + exit(BHYVE_EXIT_ERROR); } FPRINTLN(stdout, "Restoring kernel structs..."); if (vm_restore_kern_structs(ctx, &rstate) != 0) { EPRINTLN("Failed to restore kernel structs."); - exit(1); + exit(BHYVE_EXIT_ERROR); } FPRINTLN(stdout, "Resuming pci devs..."); if (vm_resume_devices() != 0) { EPRINTLN("Failed to resume PCI device state."); - exit(1); + exit(BHYVE_EXIT_ERROR); } } #endif if (bhyve_init_platform_late(ctx, bsp) != 0) - exit(4); + exit(BHYVE_EXIT_ERROR); /* * Change the proc title to include the VM name. @@ -1018,5 +1018,5 @@ main(int argc, char *argv[]) */ mevent_dispatch(); - exit(4); + exit(BHYVE_EXIT_ERROR); } diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h index 0a7bbd72a19c..5e6c81d008b8 100644 --- a/usr.sbin/bhyve/bhyverun.h +++ b/usr.sbin/bhyve/bhyverun.h @@ -34,6 +34,16 @@ #define VMEXIT_CONTINUE (0) #define VMEXIT_ABORT (-1) +/* + * Exit status codes as described in the bhyve(8) manpage. + */ +#define BHYVE_EXIT_RESET 0 +#define BHYVE_EXIT_POWEROFF 1 +#define BHYVE_EXIT_HALT 2 +#define BHYVE_EXIT_TRIPLEFAULT 3 +#define BHYVE_EXIT_ERROR 4 +#define BHYVE_EXIT_SUSPEND 5 + extern int guest_ncpus; extern uint16_t cpu_cores, cpu_sockets, cpu_threads; diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 983e7deb61c9..c0e9a1547271 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -1105,7 +1105,7 @@ gdb_cpu_breakpoint(struct vcpu *vcpu, struct vm_exit *vmexit) if (!gdb_active) { EPRINTLN("vm_loop: unexpected VMEXIT_DEBUG"); - exit(4); + exit(BHYVE_EXIT_ERROR); } vcpuid = vcpu_id(vcpu); pthread_mutex_lock(&gdb_lock); diff --git a/usr.sbin/bhyve/mevent.c b/usr.sbin/bhyve/mevent.c index dbcc39148ca1..e92ee416f342 100644 --- a/usr.sbin/bhyve/mevent.c +++ b/usr.sbin/bhyve/mevent.c @@ -55,6 +55,7 @@ #include #include +#include "bhyverun.h" #include "mevent.h" #define MEVENT_MAX 64 @@ -517,7 +518,7 @@ mevent_dispatch(void) ret = pipe(mevent_pipefd); if (ret < 0) { perror("pipe"); - exit(0); + exit(BHYVE_EXIT_ERROR); } #ifndef WITHOUT_CAPSICUM diff --git a/usr.sbin/bhyve/mevent_test.c b/usr.sbin/bhyve/mevent_test.c index 60aab4ad849a..9a1761d3ca9e 100644 --- a/usr.sbin/bhyve/mevent_test.c +++ b/usr.sbin/bhyve/mevent_test.c @@ -45,6 +45,7 @@ #include #include +#include "bhyverun.h" #include "mevent.h" #define TEST_PORT 4321 @@ -139,7 +140,7 @@ echoer(void *param) mev = mevent_add(fd, EVF_READ, echoer_callback, &sync); if (mev == NULL) { printf("Could not allocate echoer event\n"); - exit(4); + exit(BHYVE_EXIT_ERROR); } while (!pthread_cond_wait(&sync.e_cond, &sync.e_mt)) { @@ -197,7 +198,7 @@ acceptor(void *param) if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror("cannot create socket"); - exit(4); + exit(BHYVE_EXIT_ERROR); } sin.sin_len = sizeof(sin); @@ -207,12 +208,12 @@ acceptor(void *param) if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("cannot bind socket"); - exit(4); + exit(BHYVE_EXIT_ERROR); } if (listen(s, 1) < 0) { perror("cannot listen socket"); - exit(4); + exit(BHYVE_EXIT_ERROR); } (void) mevent_add(s, EVF_READ, acceptor_callback, NULL); diff --git a/usr.sbin/bhyve/riscv/bhyverun_machdep.c b/usr.sbin/bhyve/riscv/bhyverun_machdep.c index 8ee505e86679..f4c248ee662a 100644 --- a/usr.sbin/bhyve/riscv/bhyverun_machdep.c +++ b/usr.sbin/bhyve/riscv/bhyverun_machdep.c @@ -159,7 +159,7 @@ bhyve_optparse(int argc, char **argv) pci_print_supported_devices(); exit(0); } else if (pci_parse_slot(optarg) != 0) - exit(4); + exit(BHYVE_EXIT_ERROR); else break; case 'S': diff --git a/usr.sbin/bhyve/riscv/vmexit.c b/usr.sbin/bhyve/riscv/vmexit.c index 985f8e4e9065..29afdcc25352 100644 --- a/usr.sbin/bhyve/riscv/vmexit.c +++ b/usr.sbin/bhyve/riscv/vmexit.c @@ -114,15 +114,15 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) switch (how) { case VM_SUSPEND_RESET: - exit(0); + exit(BHYVE_EXIT_RESET); case VM_SUSPEND_POWEROFF: if (get_config_bool_default("destroy_on_poweroff", false)) vm_destroy(ctx); - exit(1); + exit(BHYVE_EXIT_POWEROFF); case VM_SUSPEND_HALT: - exit(2); + exit(BHYVE_EXIT_HALT); case VM_SUSPEND_DESTROY: - exit(4); + exit(BHYVE_EXIT_ERROR); default: fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); exit(100); diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index eabe6ab47f80..5b941984c0c0 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(5); + exit(BHYVE_EXIT_SUSPEND); } done: