nvmf: save hostnqn to controller data structure

When creating a new controller in the NVMe-oF target, hostnqn is
a must parameter, so we save the hostnqn to controller data
structure, and it can be used to verify the access right of
Discovery service.

Change-Id: I86a6f50d3209d5bbb8ac85508288173d826ea216
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462439
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
This commit is contained in:
Changpeng Liu 2019-07-18 04:15:54 -04:00
parent f0b7a6e7d1
commit 234eb48bf6
2 changed files with 2 additions and 0 deletions

View File

@ -324,6 +324,7 @@ spdk_nvmf_ctrlr_create(struct spdk_nvmf_subsystem *subsystem,
1;
spdk_uuid_copy(&ctrlr->hostid, (struct spdk_uuid *)connect_data->hostid);
memcpy(ctrlr->hostnqn, connect_data->hostnqn, sizeof(ctrlr->hostnqn));
ctrlr->vcprop.cap.raw = 0;
ctrlr->vcprop.cap.bits.cqr = 1; /* NVMe-oF specification required */

View File

@ -286,6 +286,7 @@ struct spdk_nvmf_reservation_log {
*/
struct spdk_nvmf_ctrlr {
uint16_t cntlid;
char hostnqn[SPDK_NVMF_NQN_MAX_LEN + 1];
struct spdk_nvmf_subsystem *subsys;
struct {