Add a bhyve_options configuration setting to allow custom bhyve(8) arguments

This commit is contained in:
Matt Churchyard
2017-06-07 16:09:03 +01:00
parent e0dcb71bf4
commit 3bbb2cb865
4 changed files with 15 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ vm::run(){
local _guest_support _uefi _uuid _utc _debug _hostbridge _loader
local _opts _devices _slot=4 _func=0 _taplist _exit _passdev
local _com _comports _comstring _logpath="/dev/null" _bootrom _run=1
local _ignore_msr
local _ignore_msr _bhyve_options
# try to load datstore details
datastore::get_guest "${_name}" || exit 5
@@ -60,6 +60,7 @@ vm::run(){
config::get "_utc" "utctime" "no"
config::get "_debug" "debug" "no"
config::get "_ignore_msr" "ignore_bad_msr" "no"
config::get "_bhyve_options" "bhyve_options"
util::log_rotate "guest" "${_name}"
util::log "guest" "${_name}" "initialising"
@@ -140,6 +141,9 @@ vm::run(){
fi
fi
# add any custom bhyve options
[ -n "${_bhyve_options}" ] && _opts="${_opts} ${_bhyve_options}"
# if we have passthru, check vt-d support now and exit
config::get "_passdev" "passthru0"

View File

@@ -59,6 +59,11 @@ memory="512M"
#
ignore_bad_msr="no"
# bhyve_options
# any additional bhyve command line options
#
bhyve_options="-p 1:1"
# hostbridge
# Allows you to specify the type of hostbridge to use for the
# guest hardware. This can usually be left as default. The

2
vm
View File

@@ -25,7 +25,7 @@
# POSSIBILITY OF SUCH DAMAGE.
VERSION=1.1-p8
VERSION_INT=101072
VERSION_INT=101073
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

4
vm.8
View File

@@ -945,6 +945,10 @@ to configure
.Xr bhyve 8
to ignore accesses to unimplemented model specific registers. This is commonly required
on AMD processors, although is enabled by default for UEFI guests.
.It bhyve_options
Specify any additional command line arguments to pass to the bhyve command. This allows
the use of options such as cpu pinning or debug that are not exposed by
.Sy vm-bhyve .
.It grub_installX
This option allows you to specify grub commands needed to boot the install media for
this guest.