Browse Source

95nvmf: Implement 'fc,auto' commandline syntax

Add a 'fc,auto' commandline syntax for nvmf.discover to force
nvmf autodiscovery on FC-NVMe.

Signed-off-by: Hannes Reinecke <hare@suse.de>
master
Hannes Reinecke 4 years ago committed by Daniel Molkentin
parent
commit
251b424727
  1. 2
      dracut.cmdline.7.asc
  2. 16
      modules.d/95nvmf/parse-nvmf-boot-connections.sh

2
dracut.cmdline.7.asc

@ -874,6 +874,8 @@ NVMf @@ -874,6 +874,8 @@ NVMf
_<traddr>_ and the optionally _<host_traddr>_ or _<trsvcid>_.
The first argument specifies the transport to use; currently only
'rdma', 'fc', or 'tcp' are supported.
The _<traddr>_ parameter can be set to 'auto' to select
autodiscovery; in that case all other parameters are ignored.
This parameter can be specified multiple times.

NBD

16
modules.d/95nvmf/parse-nvmf-boot-connections.sh

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
# nvmf.discover=tcp,192.168.1.3,,4420
# nvmf.discover=tcp,192.168.1.3
# nvmf.discover=fc,nn-0x200400a098d85236:pn-0x201400a098d85236,nn-0x200000109b7db455:pn-0x100000109b7db455
# nvmf.discover=fc,auto
#
# Note: FC does autodiscovery, so typically there is no need to
# specify any discover parameters for FC.
@ -81,21 +82,25 @@ parse_nvmf_discover() { @@ -81,21 +82,25 @@ parse_nvmf_discover() {
;;
*)
warn "Invalid arguments for nvmf.discover=$1"
return 1
return 0
;;
esac
if [ "$traddr" = "none" ] ; then
warn "traddr is mandatory for $trtype"
return 1;
return 0;
fi
if [ "$trtype" = "fc" ] ; then
if [ "$traddr" = "auto" ] ; then
rm /etc/nvme/discovery.conf
return 1
fi
if [ "$hosttraddr" = "none" ] ; then
warn "host traddr is mandatory for fc"
return 1
return 0
fi
elif [ "$trtype" != "rdma" ] && [ "$trtype" != "tcp" ] ; then
warn "unsupported transport $trtype"
return 1
return 0
fi
if [ "$trtype" = "tcp" ]; then
validate_ip_conn
@ -105,6 +110,7 @@ parse_nvmf_discover() { @@ -105,6 +110,7 @@ parse_nvmf_discover() {
else
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr --trsvcid=$trsvcid" >> /etc/nvme/discovery.conf
fi
return 0
}

nvmf_hostnqn=$(getarg nvmf.hostnqn=)
@ -117,7 +123,7 @@ if [ -n "$nvmf_hostid" ] ; then @@ -117,7 +123,7 @@ if [ -n "$nvmf_hostid" ] ; then
fi

for d in $(getargs nvmf.discover=); do
parse_nvmf_discover "$d"
parse_nvmf_discover "$d" || break
done

# Host NQN and host id are mandatory for NVMe-oF

Loading…
Cancel
Save