From b312d4bb4ba71d9c376d8675eb65ce1e4cf43188 Mon Sep 17 00:00:00 2001 From: Jesse Taube Date: Fri, 29 May 2026 11:35:48 -0400 Subject: [PATCH 1/2] build: Enable pdc-enabled by default Change the pdc-enabled build flag to true. this will create a NVMe PDC (Persistent Discovery Controller) by default for each host. Closes: #3112 Link: https://github.com/linux-nvme/nvme-cli/issues/3112 Signed-off-by: Jesse Taube --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index ff81f6fd11..f49dae803a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,7 +92,7 @@ option( option( 'pdc-enabled', type: 'boolean', - value : false, + value : true, description : 'set default Persistent Discovery Controllers behavior' ) option( From 84195dc2d46bc69897087a169d182ccd5397ea88 Mon Sep 17 00:00:00 2001 From: Jesse Taube Date: Mon, 22 Jun 2026 17:10:40 -0400 Subject: [PATCH 2/2] Add option to dissable pdc-default Signed-off-by: Jesse Taube --- fabrics.c | 11 +++++++++++ meson.build | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fabrics.c b/fabrics.c index 1780df7fb0..c511384748 100644 --- a/fabrics.c +++ b/fabrics.c @@ -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)); @@ -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"), @@ -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", diff --git a/meson.build b/meson.build index ab685270c1..10b2e37794 100644 --- a/meson.build +++ b/meson.build @@ -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(