cfg.ctrl_loss_tmo will be cleared to zero even if it wasn't set
at all, we must not pass ctrl_loss_tmo in the connection string.
This fixes a regression caused by allowing ctrl_loss_tmo to be
zero at all, by setting it to be a sane default (which currently
matches the kernel default).
Fixes: a6105a30a39a ("nvme-cli/fabrics: Add tos param to connect cmd")
Fixes: 4b607779af71 ("Allow 0 value of ctrl_loss_tmo.")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
#define NVMF_HOSTID_SIZE 36
+/* default to 600 seconds of reconnect attempts before giving up */
+#define NVMF_DEF_CTRL_LOSS_TMO 600
+
const char *conarg_nqn = "nqn";
const char *conarg_transport = "transport";
const char *conarg_traddr = "traddr";
bool persistent;
bool quiet;
bool matching_only;
-} cfg = { NULL };
+} cfg = { .ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO };
struct connect_args {
char *subsysnqn;