bool matching_only;
char *output_format;
} cfg = {
- .ctrl_loss_tmo = -1,
+ .ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO,
.output_format = "normal",
};
fprintf(stderr, "need a address (-a) argument\n");
return -EINVAL;
}
- /* Use the default ctrl loss timeout if unset */
- if (cfg.ctrl_loss_tmo == -1)
- cfg.ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO;
}
/* always specify nqn as first arg - this will init the string */
cfg.keep_alive_tmo, false) ||
add_int_argument(&argstr, &max_len, "reconnect_delay",
cfg.reconnect_delay, false) ||
- add_int_argument(&argstr, &max_len, "ctrl_loss_tmo",
- cfg.ctrl_loss_tmo, true) ||
+ (strncmp(cfg.transport, "loop", 4) &&
+ add_int_argument(&argstr, &max_len, "ctrl_loss_tmo",
+ cfg.ctrl_loss_tmo, true)) ||
add_int_argument(&argstr, &max_len, "tos",
cfg.tos, true) ||
add_bool_argument(&argstr, &max_len, "duplicate_connect",
p += len;
}
- if (cfg.ctrl_loss_tmo >= -1) {
+ if ((e->trtype != NVMF_TRTYPE_LOOP) && (cfg.ctrl_loss_tmo >= -1)) {
len = sprintf(p, ",ctrl_loss_tmo=%d", cfg.ctrl_loss_tmo);
if (len < 0)
return -EINVAL;