[--queue-size=<#> | -Q <#>]
[--persistent | -p]
[--quiet | -S]
+ [--dump-config | -O]
[--output-format=<fmt> | -o <fmt>]
DESCRIPTION
--quiet::
Suppress already connected errors.
+-O::
+--dump-config::
+ Print out resulting JSON configuration file to stdout.
+
-o <format>::
--output-format=<format>::
Set the reporting format to 'normal', 'json', or
static char *raw;
static bool persistent;
static bool quiet;
+static bool dump_config;
static const char *nvmf_tport = "transport type";
static const char *nvmf_traddr = "transport address";
OPT_FLAG("quiet", 'S', &quiet, "suppress already connected errors"),
OPT_STRING("config", 'C', "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"),
OPT_END()
};
if (!strcmp(config_file, "none"))
config_file = NULL;
+
r = nvme_scan(config_file);
if (persistent && !cfg.keep_alive_tmo)
cfg.keep_alive_tmo = 30;
free(hnqn);
if (hid)
free(hid);
+ if (dump_config)
+ nvme_dump_config(r);
nvme_free_tree(r);
return ret;
NVMF_OPTS(cfg),
OPT_STRING("config", 'C', "FILE", &config_file, nvmf_config_file),
OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"),
+ OPT_FLAG("dump-config", 'O', &dump_config, "Dump JSON configuration to stdout"),
OPT_END()
};
}
}
- if (strcmp(config_file, "none"))
+ if (!strcmp(config_file, "none"))
config_file = NULL;
+
r = nvme_scan(config_file);
if (!hostnqn)
hostnqn = hnqn = nvmf_hostnqn_from_file();
free(hnqn);
if (hid)
free(hid);
+ if (dump_config)
+ nvme_dump_config(r);
nvme_free_tree(r);
return errno;
}