]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: error message for nvme discover/connect-all with no params
authorMartin George <marting@netapp.com>
Mon, 11 Apr 2022 12:03:17 +0000 (17:33 +0530)
committerMartin George <marting@netapp.com>
Mon, 11 Apr 2022 12:03:17 +0000 (17:33 +0530)
Currently when nvme discover or connect-all is called without
passing any params, it simply blanks out without any meaningful
error. So add an appropriate error message for such scenarios,
similar to what's done in the erstwhile nvme-cli-monolithic branch.

Signed-off-by: Martin George <marting@netapp.com>
fabrics.c

index 92c5312f3c94227ef1182f6f96c1c9c197d18cbd..fad63de2412b8697548095dba8773b94ed6c6f09 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -526,6 +526,7 @@ static int discover_from_conf_file(nvme_root_t r, nvme_host_t h,
 
        f = fopen(PATH_NVMF_DISC, "r");
        if (f == NULL) {
+               fprintf(stderr, "No params given and no %s\n", PATH_NVMF_DISC);
                errno = ENOENT;
                return -1;
        }