Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136993921
D25414.id73551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D25414.id73551.diff
View Options
Index: usr.sbin/bhyve/bhyve.8
===================================================================
--- usr.sbin/bhyve/bhyve.8
+++ usr.sbin/bhyve/bhyve.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 18, 2020
+.Dd Jun 23, 2020
.Dt BHYVE 8
.Os
.Sh NAME
@@ -32,7 +32,7 @@
.Nd "run a guest operating system inside a virtual machine"
.Sh SYNOPSIS
.Nm
-.Op Fl AabCeHhPSuWwxY
+.Op Fl AabCDeHhPSuWwxY
.Oo
.Sm off
.Fl c\~
@@ -131,6 +131,8 @@
is specified more than once the last one has precedence.
.It Fl C
Include guest memory in core file.
+.It Fl D
+Destroy the VM on guest initiated power-off.
.It Fl e
Force
.Nm
Index: usr.sbin/bhyve/bhyverun.c
===================================================================
--- usr.sbin/bhyve/bhyverun.c
+++ usr.sbin/bhyve/bhyverun.c
@@ -196,6 +196,7 @@
static int guest_vmexit_on_hlt, guest_vmexit_on_pause;
static int virtio_msix = 1;
static int x2apic_mode = 0; /* default is xAPIC */
+static int destroy_on_poweroff = 0;
static int strictio;
static int strictmsr = 1;
@@ -235,7 +236,7 @@
{
fprintf(stderr,
- "Usage: %s [-abehuwxACHPSWY]\n"
+ "Usage: %s [-abehuwxACDHPSWY]\n"
" %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n"
" %*s [-g <gdb port>] [-l <lpc>]\n"
" %*s [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] <vm>\n"
@@ -243,6 +244,7 @@
" -A: create ACPI tables\n"
" -c: number of cpus and/or topology specification\n"
" -C: include guest memory in core file\n"
+ " -D: destroy on power-off\n"
" -e: exit on unhandled I/O access\n"
" -g: gdb port\n"
" -h: help\n"
@@ -800,6 +802,8 @@
case VM_SUSPEND_RESET:
exit(0);
case VM_SUSPEND_POWEROFF:
+ if (destroy_on_poweroff)
+ vm_destroy(ctx);
exit(1);
case VM_SUSPEND_HALT:
exit(2);
@@ -1086,9 +1090,9 @@
memflags = 0;
#ifdef BHYVE_SNAPSHOT
- optstr = "abehuwxACHIPSWYp:g:G:c:s:m:l:U:r:";
+ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:r:";
#else
- optstr = "abehuwxACHIPSWYp:g:G:c:s:m:l:U:";
+ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:";
#endif
while ((c = getopt(argc, argv, optstr)) != -1) {
switch (c) {
@@ -1101,6 +1105,9 @@
case 'b':
bvmcons = 1;
break;
+ case 'D':
+ destroy_on_poweroff = 1;
+ break;
case 'p':
if (pincpu_parse(optarg) != 0) {
errx(EX_USAGE, "invalid vcpu pinning "
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 10:48 PM (3 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25820374
Default Alt Text
D25414.id73551.diff (2 KB)
Attached To
Mode
D25414: bhyve: allow for automatic destruction on power-off
Attached
Detach File
Event Timeline
Log In to Comment