nvme: add nqn prefix to hostnqn
Section 7.9 of the NVMe spec says that all nqns must start with "nqn.". Fixes issue #1669. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I7fd0e6a0a397e831c4fa2377126b6b1e1b127d88 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5017 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: <dongx.yi@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
db853f0510
commit
0e47be4b41
@ -161,7 +161,8 @@ spdk_nvme_ctrlr_get_default_ctrlr_opts(struct spdk_nvme_ctrlr_opts *opts, size_t
|
||||
if (FIELD_OK(hostnqn)) {
|
||||
spdk_uuid_fmt_lower(host_id_str, sizeof(host_id_str),
|
||||
&g_spdk_nvme_driver->default_extended_host_id);
|
||||
snprintf(opts->hostnqn, sizeof(opts->hostnqn), "2014-08.org.nvmexpress:uuid:%s", host_id_str);
|
||||
snprintf(opts->hostnqn, sizeof(opts->hostnqn),
|
||||
"nqn.2014-08.org.nvmexpress:uuid:%s", host_id_str);
|
||||
}
|
||||
|
||||
if (FIELD_OK(extended_host_id)) {
|
||||
|
@ -1629,7 +1629,7 @@ test_ctrlr_get_default_ctrlr_opts(void)
|
||||
CU_ASSERT(opts.host_id[i] == 0);
|
||||
}
|
||||
CU_ASSERT_STRING_EQUAL(opts.hostnqn,
|
||||
"2014-08.org.nvmexpress:uuid:e53e9258-c93b-48b5-be1a-f025af6d232a");
|
||||
"nqn.2014-08.org.nvmexpress:uuid:e53e9258-c93b-48b5-be1a-f025af6d232a");
|
||||
CU_ASSERT(memcmp(opts.extended_host_id, &g_spdk_nvme_driver->default_extended_host_id,
|
||||
sizeof(opts.extended_host_id)) == 0);
|
||||
CU_ASSERT(strlen(opts.src_addr) == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user