Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/bhyverun.c
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | |||||
char *guest_uuid_str; | char *guest_uuid_str; | ||||
int raw_stdio = 0; | int raw_stdio = 0; | ||||
static int gdb_port = 0; | static int gdb_port = 0; | ||||
static int guest_vmexit_on_hlt, guest_vmexit_on_pause; | static int guest_vmexit_on_hlt, guest_vmexit_on_pause; | ||||
static int virtio_msix = 1; | static int virtio_msix = 1; | ||||
static int x2apic_mode = 0; /* default is xAPIC */ | static int x2apic_mode = 0; /* default is xAPIC */ | ||||
static int destroy_on_poweroff = 0; | |||||
static int strictio; | static int strictio; | ||||
static int strictmsr = 1; | static int strictmsr = 1; | ||||
static int acpi; | static int acpi; | ||||
static char *progname; | static char *progname; | ||||
static const int BSP = 0; | static const int BSP = 0; | ||||
Show All 23 Lines | |||||
static cpuset_t *vcpumap[VM_MAXCPU] = { NULL }; | static cpuset_t *vcpumap[VM_MAXCPU] = { NULL }; | ||||
static void | static void | ||||
usage(int code) | usage(int code) | ||||
{ | { | ||||
fprintf(stderr, | fprintf(stderr, | ||||
"Usage: %s [-abehuwxACHPSWY]\n" | "Usage: %s [-abehuwxACDHPSWY]\n" | ||||
" %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" | " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" | ||||
" %*s [-g <gdb port>] [-l <lpc>]\n" | " %*s [-g <gdb port>] [-l <lpc>]\n" | ||||
" %*s [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] <vm>\n" | " %*s [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] <vm>\n" | ||||
" -a: local apic is in xAPIC mode (deprecated)\n" | " -a: local apic is in xAPIC mode (deprecated)\n" | ||||
" -A: create ACPI tables\n" | " -A: create ACPI tables\n" | ||||
" -c: number of cpus and/or topology specification\n" | " -c: number of cpus and/or topology specification\n" | ||||
" -C: include guest memory in core file\n" | " -C: include guest memory in core file\n" | ||||
" -D: destroy on power-off\n" | |||||
" -e: exit on unhandled I/O access\n" | " -e: exit on unhandled I/O access\n" | ||||
" -g: gdb port\n" | " -g: gdb port\n" | ||||
" -h: help\n" | " -h: help\n" | ||||
" -H: vmexit from the guest on hlt\n" | " -H: vmexit from the guest on hlt\n" | ||||
" -l: LPC device configuration\n" | " -l: LPC device configuration\n" | ||||
" -m: memory size in MB\n" | " -m: memory size in MB\n" | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
" -r: path to checkpoint file\n" | " -r: path to checkpoint file\n" | ||||
▲ Show 20 Lines • Show All 541 Lines • ▼ Show 20 Lines | while (!CPU_EMPTY(&cpumask)) { | ||||
pthread_cond_wait(&resetcpu_cond, &resetcpu_mtx); | pthread_cond_wait(&resetcpu_cond, &resetcpu_mtx); | ||||
} | } | ||||
pthread_mutex_unlock(&resetcpu_mtx); | pthread_mutex_unlock(&resetcpu_mtx); | ||||
switch (how) { | switch (how) { | ||||
case VM_SUSPEND_RESET: | case VM_SUSPEND_RESET: | ||||
exit(0); | exit(0); | ||||
case VM_SUSPEND_POWEROFF: | case VM_SUSPEND_POWEROFF: | ||||
if (destroy_on_poweroff) | |||||
vm_destroy(ctx); | |||||
exit(1); | exit(1); | ||||
swills: Not sure 1 still makes sense in this case. It's not indicating a failure or issue of some kind… | |||||
case VM_SUSPEND_HALT: | case VM_SUSPEND_HALT: | ||||
exit(2); | exit(2); | ||||
case VM_SUSPEND_TRIPLEFAULT: | case VM_SUSPEND_TRIPLEFAULT: | ||||
exit(3); | exit(3); | ||||
default: | default: | ||||
fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); | fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); | ||||
exit(100); | exit(100); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | #endif | ||||
sockets = cores = threads = 1; | sockets = cores = threads = 1; | ||||
maxcpus = 0; | maxcpus = 0; | ||||
memsize = 256 * MB; | memsize = 256 * MB; | ||||
mptgen = 1; | mptgen = 1; | ||||
rtc_localtime = 1; | rtc_localtime = 1; | ||||
memflags = 0; | memflags = 0; | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
optstr = "abehuwxACHIPSWYp:g:G:c:s:m:l:U:r:"; | optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:r:"; | ||||
#else | #else | ||||
optstr = "abehuwxACHIPSWYp:g:G:c:s:m:l:U:"; | optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:"; | ||||
#endif | #endif | ||||
while ((c = getopt(argc, argv, optstr)) != -1) { | while ((c = getopt(argc, argv, optstr)) != -1) { | ||||
switch (c) { | switch (c) { | ||||
case 'a': | case 'a': | ||||
x2apic_mode = 0; | x2apic_mode = 0; | ||||
break; | break; | ||||
case 'A': | case 'A': | ||||
acpi = 1; | acpi = 1; | ||||
break; | break; | ||||
case 'b': | case 'b': | ||||
bvmcons = 1; | bvmcons = 1; | ||||
break; | |||||
case 'D': | |||||
destroy_on_poweroff = 1; | |||||
break; | break; | ||||
case 'p': | case 'p': | ||||
if (pincpu_parse(optarg) != 0) { | if (pincpu_parse(optarg) != 0) { | ||||
errx(EX_USAGE, "invalid vcpu pinning " | errx(EX_USAGE, "invalid vcpu pinning " | ||||
"configuration '%s'", optarg); | "configuration '%s'", optarg); | ||||
} | } | ||||
break; | break; | ||||
case 'c': | case 'c': | ||||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |
Not sure 1 still makes sense in this case. It's not indicating a failure or issue of some kind, is it?