Skip to content

Commit 264f80b

Browse files
author
olevole
committed
fix nvme realpath
1 parent e4c3c41 commit 264f80b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

subr/bhyve.subr

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,11 @@ compile_dsk_controller_args()
780780
# -s <n>,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z
781781
compile_nvme_args()
782782
{
783-
local prefix
784-
local full_dsk_path
783+
local prefix=
784+
local full_dsk_path=
785785
local sqldelimer=" "
786786
local _pcislot_args=
787+
local _res=
787788

788789
nvme_args=
789790

@@ -821,6 +822,11 @@ compile_nvme_args()
821822
nvme_args="-s ${_pcislot_args},nvme"
822823
store_bhyve_pci_slot -n nvme -a ${bhyve_pci_index}
823824

825+
_res=$( substr --pos=0 --len=1 --str="${nvme_devpath}" )
826+
if [ "${_res}" != "/" ]; then
827+
nvme_devpath="${workdir}/jails-data/${jname}-data/${nvme_devpath}"
828+
fi
829+
824830
if [ ! -r ${nvme_devpath} ]; then
825831
${ECHO} "${LDED}Warning: compile_nvme_args: path not available, skipp: ${N2_COLOR}${nvme_devpath}${N0_COLOR}"
826832
return 1

0 commit comments

Comments
 (0)