Skip to content

Commit 3bbb2cb

Browse files
committed
Add a bhyve_options configuration setting to allow custom bhyve(8) arguments
1 parent e0dcb71 commit 3bbb2cb

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

lib/vm-run

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ vm::run(){
3939
local _guest_support _uefi _uuid _utc _debug _hostbridge _loader
4040
local _opts _devices _slot=4 _func=0 _taplist _exit _passdev
4141
local _com _comports _comstring _logpath="/dev/null" _bootrom _run=1
42-
local _ignore_msr
42+
local _ignore_msr _bhyve_options
4343

4444
# try to load datstore details
4545
datastore::get_guest "${_name}" || exit 5
@@ -60,6 +60,7 @@ vm::run(){
6060
config::get "_utc" "utctime" "no"
6161
config::get "_debug" "debug" "no"
6262
config::get "_ignore_msr" "ignore_bad_msr" "no"
63+
config::get "_bhyve_options" "bhyve_options"
6364

6465
util::log_rotate "guest" "${_name}"
6566
util::log "guest" "${_name}" "initialising"
@@ -140,6 +141,9 @@ vm::run(){
140141
fi
141142
fi
142143

144+
# add any custom bhyve options
145+
[ -n "${_bhyve_options}" ] && _opts="${_opts} ${_bhyve_options}"
146+
143147
# if we have passthru, check vt-d support now and exit
144148
config::get "_passdev" "passthru0"
145149

sample-templates/config.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ memory="512M"
5959
#
6060
ignore_bad_msr="no"
6161

62+
# bhyve_options
63+
# any additional bhyve command line options
64+
#
65+
bhyve_options="-p 1:1"
66+
6267
# hostbridge
6368
# Allows you to specify the type of hostbridge to use for the
6469
# guest hardware. This can usually be left as default. The

vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# POSSIBILITY OF SUCH DAMAGE.
2626

2727
VERSION=1.1-p8
28-
VERSION_INT=101072
28+
VERSION_INT=101073
2929
VERSION_BSD=$(uname -K)
3030
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
3131

vm.8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,10 @@ to configure
945945
.Xr bhyve 8
946946
to ignore accesses to unimplemented model specific registers. This is commonly required
947947
on AMD processors, although is enabled by default for UEFI guests.
948+
.It bhyve_options
949+
Specify any additional command line arguments to pass to the bhyve command. This allows
950+
the use of options such as cpu pinning or debug that are not exposed by
951+
.Sy vm-bhyve .
948952
.It grub_installX
949953
This option allows you to specify grub commands needed to boot the install media for
950954
this guest.

0 commit comments

Comments
 (0)