Commit 32a046d7 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: fill out SUBNQN field in Identify Controller



SUBNQN is a UTF-8 null terminated string according to the NVMe base
spec, so pad it with zeroes using strncpy().

Change-Id: I486161b26d91f3ea1fd17428e220b9f20a874732
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 37402f49
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ nvmf_init_discovery_session_properties(struct nvmf_session *session)
	session->vcdata.sgls.keyed_sgl = 1;
	session->vcdata.sgls.sgl_offset = 1;

	strncpy((char *)session->vcdata.subnqn, SPDK_NVMF_DISCOVERY_NQN, sizeof(session->vcdata.subnqn));

	/* Properties */
	session->vcprop.cap.raw = 0;
	session->vcprop.cap.bits.cqr = 1;	/* NVMF specification required */
@@ -105,6 +107,8 @@ nvmf_init_nvme_session_properties(struct nvmf_session *session)
	/* TODO: this should be set by the transport */
	session->vcdata.nvmf_specific.ioccsz += g_nvmf_tgt.in_capsule_data_size / 16;

	strncpy((char *)session->vcdata.subnqn, session->subsys->subnqn, sizeof(session->vcdata.subnqn));

	SPDK_TRACELOG(SPDK_TRACE_NVMF, "	ctrlr data: maxcmd %x\n",
		      session->vcdata.maxcmd);
	SPDK_TRACELOG(SPDK_TRACE_NVMF, "	ext ctrlr data: ioccsz %x\n",