diff --git a/Documentation/nvme-config.txt b/Documentation/nvme-config.txt index 8a66644754..98009e4d8e 100644 --- a/Documentation/nvme-config.txt +++ b/Documentation/nvme-config.txt @@ -27,7 +27,7 @@ SYNOPSIS [--keep-alive-tmo=<#> | -k <#>] [--reconnect-delay=<#> | -c <#>] [--ctrl-loss-tmo=<#> | -l <#>] - [--duplicate-connect | -D] [--disable-sqflow | -d] + [--duplicate-connect | -D] [--disable-sqflow ] [--hdr-digest | -g] [--data-digest | -G] [--output-format= | -o ] [--verbose | -v] @@ -168,7 +168,6 @@ OPTIONS Allows duplicated connections between same transport host and subsystem port. --d:: --disable-sqflow:: Disables SQ flow control to omit head doorbell update for submission queues when sending nvme completions. diff --git a/Documentation/nvme-connect-all.txt b/Documentation/nvme-connect-all.txt index 4cd1873426..68708e5ffb 100644 --- a/Documentation/nvme-connect-all.txt +++ b/Documentation/nvme-connect-all.txt @@ -27,7 +27,7 @@ SYNOPSIS [--nr-poll-queues=<#> | -P <#>] [--queue-size=<#> | -Q <#>] [--keyring=<#>] [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G] - [--persistent | -p] [--tls] [--concat] [--quiet | -S] + [--persistent | -p] [--tls] [--concat] [--quiet] [--dump-config | -O] [--nbft] [--no-nbft] [--nbft-path=] [--context=] [--output-format= | -o ] [--verbose | -v] @@ -189,7 +189,6 @@ OPTIONS --concat:: Enable secure concatenation (TCP). --S:: --quiet:: Suppress error messages. diff --git a/Documentation/nvme-connect.txt b/Documentation/nvme-connect.txt index 72b80007e9..0112e110be 100644 --- a/Documentation/nvme-connect.txt +++ b/Documentation/nvme-connect.txt @@ -27,7 +27,7 @@ SYNOPSIS [--reconnect-delay=<#> | -c <#>] [--ctrl-loss-tmo=<#> | -l <#>] [--tos=<#> | -T <#>] [--keyring=<#>] [--tls_key=<#>] - [--duplicate-connect | -D] [--disable-sqflow | -d] + [--duplicate-connect | -D] [--disable-sqflow ] [--hdr-digest | -g] [--data-digest | -G] [--tls] [--concat] [--dump-config | -O] [--application=] [--output-format= | -o ] [--verbose | -v] @@ -162,7 +162,6 @@ OPTIONS Allows duplicated connections between same transport host and subsystem port. --d:: --disable-sqflow:: Disables SQ flow control to omit head doorbell update for submission queues when sending nvme completions. diff --git a/Documentation/nvme-discover.txt b/Documentation/nvme-discover.txt index 1069d3cea1..e3017eb964 100644 --- a/Documentation/nvme-discover.txt +++ b/Documentation/nvme-discover.txt @@ -27,7 +27,7 @@ SYNOPSIS [--nr-poll-queues=<#> | -P <#>] [--queue-size=<#> | -Q <#>] [--keyring=<#>] [--tls_key=<#>] [--hdr-digest | -g] [--data-digest | -G] - [--persistent | -p] [--quiet | -S] [--tls] [--concat] + [--persistent | -p] [--quiet] [--tls] [--concat] [--dump-config | -O] [--output-format= | -o ] [--force] [--nbft] [--no-nbft] [--nbft-path=] [--context=] @@ -209,7 +209,6 @@ OPTIONS --concat:: Enable secure concatenation (TCP). --S:: --quiet:: Suppress already connected errors. diff --git a/completions/_nvme b/completions/_nvme index 28786bbdfb..7ae208a623 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -2014,7 +2014,6 @@ _nvme () { --duplicate-connect':allow duplicate connections between same transport host and subsystem port' -D':alias for --duplicate-connect' --disable-sqflow':disable controller sq flow control (default false)' - -d':alias for --disable-sqflow' --hdr-digest':enable transport protocol header digest (TCP transport)' -g':alias for --hdr-digest' --data-digest':enable transport protocol data digest (TCP transport)' @@ -2027,7 +2026,6 @@ _nvme () { --persistent':' -p':alias for --' --quiet':' - -S':alias for --' --config=':Use specified JSON configuration file or none to disable' -J':alias for --config' --verbose':Increase logging verbosity' @@ -2086,7 +2084,6 @@ _nvme () { --duplicate-connect':allow duplicate connections between same transport host and subsystem port' -D':alias for --duplicate-connect' --disable-sqflow':disable controller sq flow control (default false)' - -d':alias for --disable-sqflow' --hdr-digest':enable transport protocol header digest (TCP transport)' -g':alias for --hdr-digest' --data-digest':enable transport protocol data digest (TCP transport)' @@ -2099,7 +2096,6 @@ _nvme () { --persistent':' -p':alias for --' --quiet':' - -S':alias for --' --config=':Use specified JSON configuration file or none to disable' -J':alias for --config' --verbose':Increase logging verbosity' @@ -2156,7 +2152,6 @@ _nvme () { --duplicate-connect':allow duplicate connections between same transport host and subsystem port' -D':alias for --duplicate-connect' --disable-sqflow':disable controller sq flow control (default false)' - -d':alias for --disable-sqflow' --hdr-digest':enable transport protocol header digest (TCP transport)' -g':alias for --hdr-digest' --data-digest':enable transport protocol data digest (TCP transport)' diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index 00ea5e9b27..d6285664cf 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -388,7 +388,7 @@ nvme_list_opts () { --tos= -T --hdr-digest= -g --data-digest -G \ --nr-io-queues= -i --nr-write-queues= -W \ --nr-poll-queues= -P --queue-size= -Q \ - --persistent -p --quiet -S \ + --persistent -p --quiet \ --output-format= -o" ;; "connect-all") @@ -400,7 +400,7 @@ nvme_list_opts () { --tos= -T --hdr-digest= -g --data-digest -G \ --nr-io-queues= -i --nr-write-queues= -W \ --nr-poll-queues= -P --queue-size= -Q \ - --persistent -p --quiet -S \ + --persistent -p --quiet \ --output-format= -o" ;; "connect") @@ -409,7 +409,7 @@ nvme_list_opts () { --nr-poll-queues= -P --queue-size= -Q \ --keep-alive-tmo= -k --reconnect-delay= -r \ --ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \ - --tos= -T --duplicate-connect -D --disable-sqflow -d\ + --tos= -T --duplicate-connect -D --disable-sqflow \ --hdr-digest -g --data-digest -G --output-format= -o" ;; "dim") diff --git a/fabrics.c b/fabrics.c index f8136c4ab8..bd88cb2fe6 100644 --- a/fabrics.c +++ b/fabrics.c @@ -114,7 +114,7 @@ static const char *nvmf_context = "execution context identification string"; OPT_INT("keyring", 0, &c.keyring, nvmf_keyring), \ OPT_INT("tls_key", 0, &c.tls_key, nvmf_tls_key), \ OPT_FLAG("duplicate-connect", 'D', &c.duplicate_connect, nvmf_dup_connect), \ - OPT_FLAG("disable-sqflow", 'd', &c.disable_sqflow, nvmf_disable_sqflow), \ + OPT_FLAG("disable-sqflow", 0, &c.disable_sqflow, nvmf_disable_sqflow), \ OPT_FLAG("hdr-digest", 'g', &c.hdr_digest, nvmf_hdr_digest), \ OPT_FLAG("data-digest", 'G', &c.data_digest, nvmf_data_digest), \ OPT_FLAG("tls", 0, &c.tls, nvmf_tls), \ @@ -420,7 +420,7 @@ static int discover_from_conf_file(nvme_root_t r, nvme_host_t h, OPT_FMT("output-format", 'o', &format, output_format), OPT_FILE("raw", 'r', &raw, "save raw output to file"), OPT_FLAG("persistent", 'p', &persistent, "persistent discovery connection"), - OPT_FLAG("quiet", 'S', &quiet, "suppress already connected errors"), + OPT_FLAG("quiet", 0, &quiet, "suppress already connected errors"), OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"), OPT_FLAG("force", 0, &force, "Force persistent discovery controller creation")); @@ -666,6 +666,15 @@ static int nvme_read_volatile_config(nvme_root_t r) return ret; } +static int nvme_read_config_checked(nvme_root_t r, const char *filename) +{ + if (!access(filename, F_OK)) + return -ENOENT; + if (nvme_read_config(r, filename)) + return -errno; + return 0; +} + int nvmf_discover(const char *desc, int argc, char **argv, bool connect) { char *subsysnqn = NVME_DISC_SUBSYS_NAME; @@ -694,7 +703,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) OPT_FMT("output-format", 'o', &format, output_format), OPT_FILE("raw", 'r', &raw, "save raw output to file"), OPT_FLAG("persistent", 'p', &persistent, "persistent discovery connection"), - OPT_FLAG("quiet", 'S', &quiet, "suppress already connected errors"), + OPT_FLAG("quiet", 0, &quiet, "suppress already connected errors"), OPT_STRING("config", 'J', "FILE", &config_file, nvmf_config_file), OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"), OPT_FLAG("dump-config", 'O', &dump_config, "Dump configuration file to stdout"), @@ -730,7 +739,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) if (context) nvme_root_set_application(r, context); - if (!nvme_read_config(r, config_file)) + if (!nvme_read_config_checked(r, config_file)) json_config = true; if (!nvme_read_volatile_config(r)) json_config = true;