From 61e5c0b660e09bc1a98c90d1f42df00f30b16cd6 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Thu, 12 Aug 2021 10:19:53 +0200 Subject: [PATCH] fabrics: skip '/dev/' prefix on disconnect 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 --- fabrics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fabrics.c b/fabrics.c index c6c98761..258da50c 100644 --- 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, -- 2.50.1