Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ static int hook_parser_next_line(struct libnvmf_context *fctx, void *user_data)
bool force = false;

NVMF_ARGS(opts, fa,
#if NVME_DEFAULT_PDC_ENABLED
OPT_FLAG("non-persistent",'P', &persistent, "non-persistent discovery connection"),
#else
OPT_FLAG("persistent", 'p', &persistent, "persistent discovery connection"),
#endif
OPT_FLAG("force", 0, &force, "Force persistent discovery controller creation"));

memcpy(&fa, hfd->fa, sizeof(fa));
Expand Down Expand Up @@ -581,7 +585,11 @@ int fabrics_discovery(const char *desc, int argc, char **argv, bool connect)
NVMF_ARGS(opts, fa,
OPT_STRING("device", 'd', "DEV", &device, "use existing discovery controller device"),
OPT_FILE("raw", 'r', &raw, "save raw output to file"),
#if NVME_DEFAULT_PDC_ENABLED
OPT_FLAG("non-persistent",'P', &persistent, "non-persistent discovery connection"),
#else
OPT_FLAG("persistent", 'p', &persistent, "persistent discovery connection"),
#endif
OPT_FLAG("quiet", 0, &quiet, "suppress already connected errors"),
OPT_STRING("config", 'J', "FILE", &config_file, nvmf_config_file),
OPT_FLAG("dump-config", 'O', &dump_config, "Dump configuration file to stdout"),
Expand Down Expand Up @@ -610,6 +618,9 @@ int fabrics_discovery(const char *desc, int argc, char **argv, bool connect)

log_level = map_log_level(nvme_args.verbose, quiet);

if (NVME_DEFAULT_PDC_ENABLED)
persistent = !persistent;

ctx = libnvme_create_global_ctx(stderr, log_level);
if (!ctx) {
fprintf(stderr, "Failed to create topology root: %s\n",
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?'
conf.set('NVME_VERSION', '"@0@"'.format(meson.project_version()))
conf.set('LIBNVME_VERSION', '"@0@"'.format(meson.project_version()))

conf.set10('DEFAULT_PDC_ENABLED', get_option('pdc-enabled'))
conf.set10('NVME_DEFAULT_PDC_ENABLED', get_option('pdc-enabled'))
conf.set10('DEFAULT_PDC_ENABLED', false)

# local (cross-compilable) implementations of ccan configure steps
conf.set10(
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ option(
option(
'pdc-enabled',
type: 'boolean',
value : false,
value : true,
description : 'set default Persistent Discovery Controllers behavior'
)
option(
Expand Down
Loading