When calling 'nvme discover --device' 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 discover.
Signed-off-by: Hannes Reinecke <hare@suse.de>
ret = ENOMEM;
goto out_free;
}
- if (device && !strcmp(device, "none"))
- device = NULL;
+ if (device) {
+ if (!strcmp(device, "none"))
+ device = NULL;
+ else if (!strncmp(device, "/dev/", 5))
+ device += 5;
+ }
if (!device && !transport && !traddr) {
ret = discover_from_conf_file(h, desc, connect, &cfg);