]> www.infradead.org Git - users/hch/nvme-cli.git/commit
fabrics: Allow discover params to come from a conf file
authorSagi Grimberg <sagi@grimberg.me>
Tue, 16 Aug 2016 09:46:26 +0000 (12:46 +0300)
committerKeith Busch <keith.busch@intel.com>
Tue, 16 Aug 2016 15:58:45 +0000 (09:58 -0600)
commiteb246f1b7d549044cea1f2ef815bbb3e0cf5b04e
tree6847e914b768ea64efa688a85350ab42c55fabc1
parent4fbd4c36c8b8345db9b91c3aeb7ba908dd96fb33
fabrics: Allow discover params to come from a conf file

Allow the user to just run "nvme discover" or "nvme connect-all"
in case it finds a default /etc/nvme/nvmf_disc conf file.

We allow multiple discovery addresses by iterating over the
lines of the file and executing a discover (with or without
connect) for each line. We allow newlines and '#' prefixed comments.

The return value is or'ed on all discover attempts.

In order to minimize some parsing code, I just convert the
file line into an (argc, argv) pair and feed it to argconfig_parse()
which dictates that the file lines are identical to what one would
pass nvme discover <params>. I'm open to better ideas.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
fabrics.c