Add option -C to have the guest memory included in core files.

This aids in debugging OS loaders.
This commit is contained in:
Marcel Moolenaar 2016-02-26 16:15:02 +00:00
parent 48f337b82c
commit 568e3a8d7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296102
2 changed files with 12 additions and 2 deletions

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 7, 2015
.Dd February 26, 2016
.Dt BHYVELOAD 8
.Os
.Sh NAME
@ -35,6 +35,7 @@
guest inside a bhyve virtual machine
.Sh SYNOPSIS
.Nm
.Op Fl C
.Op Fl S
.Op Fl c Ar cons-dev
.Op Fl d Ar disk-path
@ -125,6 +126,12 @@ respectively.
The default value of
.Ar mem-size
is 256M.
.It Fl C
Include guest memory in the core file when
.Nm
dumps core.
This is intended for debugging an OS loader as it allows inspection of
the guest memory.
.It Fl S
Wire guest memory.
.El

View File

@ -674,7 +674,7 @@ main(int argc, char** argv)
consin_fd = STDIN_FILENO;
consout_fd = STDOUT_FILENO;
while ((opt = getopt(argc, argv, "Sc:d:e:h:l:m:")) != -1) {
while ((opt = getopt(argc, argv, "CSc:d:e:h:l:m:")) != -1) {
switch (opt) {
case 'c':
error = altcons_open(optarg);
@ -709,6 +709,9 @@ main(int argc, char** argv)
if (error != 0)
errx(EX_USAGE, "Invalid memsize '%s'", optarg);
break;
case 'C':
memflags |= VM_MEM_F_INCORE;
break;
case 'S':
memflags |= VM_MEM_F_WIRED;
break;