]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-cli: Expand --device argument processing
authorJames Smart <jsmart2021@gmail.com>
Thu, 1 Aug 2019 23:13:46 +0000 (16:13 -0700)
committerKeith Busch <kbusch@kernel.org>
Fri, 2 Aug 2019 15:43:08 +0000 (09:43 -0600)
commitd28c5dea0ac410bde33e4db2a52c903abe3f67a1
tree0ad164154d5d7b3940b19740bfab8ad7e928e64f
parent035314a35f3a95f36f3f34a4d7928a3bd31a871e
nvme-cli: Expand --device argument processing

The connect-all --device argument was used to specify a specific device
to be used as the discovery controller. The device is typically a
long-lived discovery controller that posted a discovery event.
No attempt was made to ensure the device is who it is supposed to be
before using it.

Revised the code to use the other arguments in the connect-all request
to validate that the device is the entity that was expected. If the
device doesn't match, the cli will look for an existing matching device
in the system (should be a discovery controller due to nqn) with the
same connect parameters and use it.  If one is not found on the system,
a new discovery controller will be created for the connect-all request.

The revision uses new routines to parse the connect arguments given
in the argstr parameter. As a couple of new fieldnames are needed, the
parse routine constants were expanded for them.

The revision uses the new routines to match the specified device vs
it's attributes as well as the search routine that looks for a device
with the connect arguments.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
fabrics.c
nvme.c
nvme.h