]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: skip '/dev/' prefix on disconnect
authorHannes Reinecke <hare@suse.de>
Thu, 12 Aug 2021 08:19:53 +0000 (10:19 +0200)
committerKeith Busch <kbusch@kernel.org>
Thu, 12 Aug 2021 15:47:09 +0000 (09:47 -0600)
When calling 'nvme disconnect -d' one has to remember to strip the
'/dev/' prefix from the nvme controller device name, which is
quite cumbersome and pointless, as we might as well do it internally.
So be a bit more lenient and accept full device node names on disconnect.

Signed-off-by: Hannes Reinecke <hare@suse.de>
fabrics.c

index c6c9876116d646aa86e9360b80a7ac288e555704..258da50cc8a8578a5bdded2ebd939bb643782743 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -695,6 +695,8 @@ int nvmf_disconnect(const char *desc, int argc, char **argv)
 
                d = cfg.device;
                while ((p = strsep(&d, ",")) != NULL) {
+                       if (!strncmp(p, "/dev/", 5))
+                               p += 5;
                        c = nvme_scan_ctrl(r, p);
                        if (!c) {
                                nvme_msg(LOG_ERR,