Page MenuHomeFreeBSD

D59123.id184783.diff
No OneTemporary

D59123.id184783.diff

diff --git a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c
--- a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+++ b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c
@@ -129,7 +129,7 @@
const char *optstr;
int c;
- optstr = "hCDMSWk:f:o:p:G:c:s:m:U:";
+ optstr = "hCDMNSWk:f:o:p:G:c:s:m:U:";
while ((c = getopt(argc, argv, optstr)) != -1) {
switch (c) {
case 'c':
@@ -154,7 +154,10 @@
set_config_value("memory.size", optarg);
break;
case 'M':
- set_config_bool("monitor", true);
+ set_config_bool("monitor.enabled", true);
+ break;
+ case 'N':
+ set_config_bool("monitor.no_reboot", true);
break;
case 'o':
if (!bhyve_parse_config_option(optarg)) {
diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
--- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c
+++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
@@ -98,6 +98,7 @@
" -l: LPC device configuration\n"
" -M: monitor mode\n"
" -m: memory size\n"
+ " -N: don't reboot while in monitor mode\n"
" -n: NUMA domain specification\n"
" -o: set config 'var' to 'value'\n"
" -P: vmexit from the guest on pause\n"
@@ -125,9 +126,9 @@
int c;
#ifdef BHYVE_SNAPSHOT
- optstr = "aehuwxACDHIMPSWYk:f:o:p:G:c:s:m:n:l:K:U:r:";
+ optstr = "aehuwxACDHIMNPSWYk:f:o:p:G:c:s:m:n:l:K:U:r:";
#else
- optstr = "aehuwxACDHIMPSWYk:f:o:p:G:c:s:m:n:l:K:U:";
+ optstr = "aehuwxACDHIMNPSWYk:f:o:p:G:c:s:m:n:l:K:U:";
#endif
while ((c = getopt(argc, argv, optstr)) != -1) {
switch (c) {
@@ -203,7 +204,7 @@
set_config_value("memory.size", optarg);
break;
case 'M':
- set_config_bool("monitor", true);
+ set_config_bool("monitor.enabled", true);
break;
case 'n':
if (bhyve_numa_parse(optarg) != 0)
@@ -214,6 +215,9 @@
if (!get_config_bool("acpi_tables"))
errx(EX_USAGE, "NUMA emulation requires ACPI");
break;
+ case 'N':
+ set_config_bool("monitor.no_reboot", true);
+ break;
case 'o':
if (!bhyve_parse_config_option(optarg)) {
errx(EX_USAGE,
diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 5, 2026
+.Dd August 23, 2026
.Dt BHYVE 8
.Os
.Sh NAME
@@ -34,7 +34,7 @@
.Nd "run a guest operating system inside a virtual machine"
.Sh SYNOPSIS
.Nm
-.Op Fl aCDeHhMPSuWwxY
+.Op Fl aCDeHhMNPSuWwxY
.Oo
.Sm off
.Fl c\~
@@ -345,6 +345,8 @@
flag in
.Xr cpuset 1
for a list of valid NUMA memory allocation policies and their formats.
+.It Fl N
+Prevent monitor mode from automatically rebooting the virtual machine.
.It Fl o Ar var Ns Cm = Ns Ar value
Set the configuration variable
.Ar var
diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5
--- a/usr.sbin/bhyve/bhyve_config.5
+++ b/usr.sbin/bhyve/bhyve_config.5
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 14, 2026
+.Dd August 23, 2026
.Dt BHYVE_CONFIG 5
.Os
.Sh NAME
@@ -242,6 +242,8 @@
mode.
More details are provided in
.Xr bhyve 8 .
+.It Va monitor.no_reboot Ta bool Ta false Ta
+Prevent monitor mode from automatically rebooting the virtual machine.
.It Va vcpu.N.cpuset Ta string Ta none Ta
Comma-separated host CPU IDs and ranges to which virtual CPU
.Em N
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -752,7 +752,7 @@
int error, flags;
bool romboot, monitor;
- monitor = get_config_bool_default("monitor", false);
+ monitor = get_config_bool_default("monitor.enabled", false);
romboot = bootrom_boot();
/*
@@ -943,7 +943,7 @@
init_mem(guest_ncpus);
init_bootrom(ctx);
- if (get_config_bool_default("monitor", false)) {
+ if (get_config_bool_default("monitor.enabled", false)) {
int monitor_pipe[2];
pid_t child;
@@ -978,7 +978,8 @@
exit(BHYVE_EXIT_ERROR);
} else {
status = WEXITSTATUS(status);
- if (status != BHYVE_EXIT_RESET)
+ if (get_config_bool_default("monitor.no_reboot", false) ||
+ status != BHYVE_EXIT_RESET)
exit(status);
}
if (vm_reinit(ctx) != 0) {
diff --git a/usr.sbin/bhyve/riscv/bhyverun_machdep.c b/usr.sbin/bhyve/riscv/bhyverun_machdep.c
--- a/usr.sbin/bhyve/riscv/bhyverun_machdep.c
+++ b/usr.sbin/bhyve/riscv/bhyverun_machdep.c
@@ -123,7 +123,7 @@
const char *optstr;
int c;
- optstr = "hCDMSWk:f:o:p:c:s:m:U:";
+ optstr = "hCDMNSWk:f:o:p:c:s:m:U:";
while ((c = getopt(argc, argv, optstr)) != -1) {
switch (c) {
case 'c':
@@ -142,11 +142,14 @@
bhyve_parse_simple_config_file(optarg);
break;
case 'M':
- set_config_bool("monitor", true);
+ set_config_bool("monitor.enabled", true);
break;
case 'm':
set_config_value("memory.size", optarg);
break;
+ case 'N':
+ set_config_bool("monitor.no_reboot", true);
+ break;
case 'o':
if (!bhyve_parse_config_option(optarg)) {
errx(EX_USAGE,

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 26, 12:26 AM (4 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37258018
Default Alt Text
D59123.id184783.diff (5 KB)

Event Timeline