[PATCH 18/35] monitor: add "--persistent/-p" flag

mwilck at suse.com mwilck at suse.com
Tue Jan 26 15:33:07 EST 2021


From: Martin Wilck <mwilck at suse.com>

Without this flag, AENs on created controllers won't be received.
While --persistent is probably the behavior most users will want,
it has to be explicitly activated, to be consistent with the
connect-all command.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 monitor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/monitor.c b/monitor.c
index 8db40e6..419c5f5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -487,6 +487,7 @@ static int monitor_parse_opts(const char *desc, int argc, char **argv)
 
 	OPT_ARGS(opts) = {
 		OPT_FLAG("autoconnect",    'A', &mon_cfg.autoconnect, "automatically connect newly discovered controllers"),
+		OPT_FLAG("persistent",     'p', &cfg.persistent,      "persistent discovery connections"),
 		OPT_FLAG("silent",         'S', &quiet,               "log level: silent"),
 		OPT_FLAG("verbose",        'v', &verbose,             "log level: verbose"),
 		OPT_FLAG("debug",          'D', &debug,               "log level: debug"),
@@ -514,6 +515,10 @@ static int monitor_parse_opts(const char *desc, int argc, char **argv)
 			ret = 0;
 		}
 	}
+
+	if (cfg.persistent && !cfg.keep_alive_tmo)
+		cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO;
+
 	return ret;
 }
 
-- 
2.29.2




More information about the Linux-nvme mailing list