Comment 12 for bug 1867366

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Okay, checking focal source code..

config::hostid seems to used at:

build_options() <- generic function setting variables
connect_ctrl() <- function connecting to NVMEoF controller
connect() <- function to to connect to NVMEoF
discover() <- same thing
nvmf_hostid_file() <- function reading config file and setting variable

So, for connect() we do have:

  {"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument, "user-defined hostnqn" },
  {"hostid", 'I', "LIST", CFG_STRING, &cfg.hostid, required_argument, "user-defined hostid (if default not used)"},

and for discovery we have:

  {"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument, "user-defined hostnqn (if default not used)" },
  {"hostid", 'I', "LIST", CFG_STRING, &cfg.hostid, required_argument, "user-defined hostid (if default not used)"},

Both are REQUIRED and would always be the same for all nodes (hostid would always be the same and hostnqn would always be nothing). This, per se, is already broken as a hostnqn is REQUIRED.

So, for Focal, I would say... re-creating both files IF hostnqn is empty would ALWAYS be a safe thing to be done. It means that there was no manual intervention to the config files... and without a hostnqn there would be no discovery or connection (so end user is not using NVME over Fabrics anyway).

Now, if user has changed hostnqn, we could display a warning saying the UUID should be checked for duplicates.

Let me see what you're doing now...