Add HD Audio device to guest via config

This commit is contained in:
Daniel Dowse
2022-01-28 03:37:31 +01:00
parent 678832df94
commit 10d726ebbe
2 changed files with 20 additions and 0 deletions

View File

@@ -192,6 +192,7 @@ vm::run(){
vm::bhyve_device_passthru
vm::bhyve_device_fbuf
vm::bhyve_device_mouse
vm::bhyve_device_sound
vm::bhyve_device_console
vm::lock
@@ -718,6 +719,16 @@ vm::bhyve_device_mouse(){
fi
}
vm::bhyve_device_sound(){
local _play
config::get "_play" "sound_play" "/dev/dsp0"
if config::yesno "sound"; then
_devices="${_devices} -s ${_slot}:0,hda,play=${_play}"
_slot=$((_slot + 1))
fi
}
# add virtio_console devices to the guest
#
# @modifies _devices _slot