return strcasecmp(s1, s2);
}
+static bool is_persistent_discovery_ctrl(nvme_host_t h, nvme_ctrl_t c)
+{
+ if (nvme_host_is_pdc_enabled(h, DEFAULT_PDC_ENABLED))
+ return nvme_ctrl_is_unique_discovery_ctrl(c);
+
+ return false;
+}
+
static bool disc_ctrl_config_match(nvme_ctrl_t c, struct tr_config *trcfg)
{
if (!strcmp0(nvme_ctrl_get_transport(c), trcfg->transport) &&
goto next;
__discover(c, &cfg, raw, connect, persistent, flags);
- if (!(persistent || nvme_ctrl_is_unique_discovery_ctrl(c)))
+ if (!(persistent || is_persistent_discovery_ctrl(h, c)))
ret = nvme_disconnect_ctrl(c);
nvme_free_ctrl(c);
continue;
__discover(cn, &cfg, raw, connect, persistent, flags);
- if (!(persistent || nvme_ctrl_is_unique_discovery_ctrl(cn)))
+ if (!(persistent || is_persistent_discovery_ctrl(h, cn)))
ret = nvme_disconnect_ctrl(cn);
nvme_free_ctrl(cn);
}
}
ret = __discover(c, &cfg, raw, connect, persistent, flags);
- if (!(persistent || nvme_ctrl_is_unique_discovery_ctrl(c)))
+ if (!(persistent || is_persistent_discovery_ctrl(h, c)))
nvme_disconnect_ctrl(c);
nvme_free_ctrl(c);
# Set the nvme-cli version
conf.set('NVME_VERSION', '"' + meson.project_version() + '"')
+conf.set10('DEFAULT_PDC_ENABLED', get_option('pdc-enabled'))
+
# local (cross-compilable) implementations of ccan configure steps
conf.set10(
'HAVE_BUILTIN_TYPES_COMPATIBLE_P',
option('systemctl', type : 'string', value : '/usr/bin/systemctl', description : 'path to systemctl binary')
option('nvme-tests', type : 'boolean', value : false, description: 'Run tests against real hardware')
option('docs', type : 'combo', choices : ['false', 'html', 'man', 'all'], description : 'install documentation')
-option('docs-build', type : 'boolean', value : false, description : 'build documentation')
+option('docs-build', type : 'boolean', value : false, description : 'build documentation')
+option('pdc-enabled', type: 'boolean', value : false, description : 'set default Persistent Discovery Controllers behavior')