Skip to content

Commit

Permalink
fix(nvmf): make sure "rd.nvmf.discover=fc,auto" takes precedence
Browse files Browse the repository at this point in the history
The command line may contain several rd.nvmf.discover options.
The "fc,auto" option should take precedence.
mwilck authored and johannbg committed Sep 30, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent e93e465 commit 556ef46
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions modules.d/95nvmf/parse-nvmf-boot-connections.sh
Original file line number Diff line number Diff line change
@@ -92,19 +92,21 @@ if [ -n "$nvmf_hostid" ]; then
echo "$nvmf_hostid" > /etc/nvme/hostid
fi

NVMF_FC_AUTO=
for d in $(getargs rd.nvmf.discover -d nvmf.discover=); do
parse_nvmf_discover "$d" || break
parse_nvmf_discover "$d" || {
NVMF_FC_AUTO=1
break
}
done

# Host NQN and host id are mandatory for NVMe-oF
[ -f "/etc/nvme/hostnqn" ] || exit 0
[ -f "/etc/nvme/hostid" ] || exit 0

if [ -f "/etc/nvme/discovery.conf" ]; then
/sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
# If no nvme command line arguments present, try autodiscovery
if [ $NVMF_FC_AUTO ] || [ ! -f "/etc/nvme/discovery.conf" ]; then
/sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh
else
# No nvme command line arguments present, try autodiscovery
if [ "$trtype" = "fc" ]; then
/sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh
fi
/sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
fi

0 comments on commit 556ef46

Please sign in to comment.