Skip to content

Commit 9404384

Browse files
authored
Merge pull request #138 from tbzatek/fabrics-fixes-3
Misc. fabrics fixes
2 parents 9a7e231 + 6e9b357 commit 9404384

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/nvme/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ char *nvmf_hostnqn_generate()
958958
if (ret < 0)
959959
return NULL;
960960

961-
if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s\n", uuid_str) < 0)
961+
if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s", uuid_str) < 0)
962962
return NULL;
963963

964964
return hostnqn;

src/nvme/fabrics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp,
179179

180180
/**
181181
* nvmf_hostnqn_generate() - Generate a machine specific host nqn
182-
* Returns: An nvm namespace qualifieid name string based on the machine
182+
* Returns: An nvm namespace qualified name string based on the machine
183183
* identifier, or NULL if not successful.
184184
*/
185185
char *nvmf_hostnqn_generate();

src/nvme/tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ struct nvme_host *nvme_lookup_host(nvme_root_t r, const char *hostnqn,
374374
nvme_for_each_host(r, h) {
375375
if (strcmp(h->hostnqn, hostnqn))
376376
continue;
377-
if (hostid &&
378-
strcmp(h->hostid, hostid))
377+
if (hostid && (!h->hostid ||
378+
strcmp(h->hostid, hostid)))
379379
continue;
380380
return h;
381381
}

0 commit comments

Comments
 (0)