Commit 524e8fc9 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: centralize duplicate subsystem NQN check



This should be enforced by the main NVMe-oF target library, not in the
event subsystem code.

Change-Id: Ibce4fd78710b4a9da374e3d5979df4a16e91533c
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403380


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 3f987aa8
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -88,11 +88,6 @@ nvmf_tgt_create_subsystem(const char *name, enum spdk_nvmf_subtype subtype, uint
{
	struct spdk_nvmf_subsystem *subsystem;

	if (spdk_nvmf_tgt_find_subsystem(g_tgt.tgt, name)) {
		SPDK_ERRLOG("Subsystem already exist\n");
		return NULL;
	}

	subsystem = spdk_nvmf_subsystem_create(g_tgt.tgt, name, subtype, num_ns);
	if (subsystem == NULL) {
		SPDK_ERRLOG("Subsystem creation failed\n");
+5 −0
Original line number Diff line number Diff line
@@ -222,6 +222,11 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
	struct spdk_nvmf_subsystem	*subsystem;
	uint32_t			sid;

	if (spdk_nvmf_tgt_find_subsystem(tgt, nqn)) {
		SPDK_ERRLOG("Subsystem NQN '%s' already exists\n", nqn);
		return NULL;
	}

	if (!spdk_nvmf_valid_nqn(nqn)) {
		return NULL;
	}
+6 −0
Original line number Diff line number Diff line
@@ -105,6 +105,12 @@ spdk_nvmf_transport_create(struct spdk_nvmf_tgt *tgt,
	return NULL;
}

struct spdk_nvmf_subsystem *
spdk_nvmf_tgt_find_subsystem(struct spdk_nvmf_tgt *tgt, const char *subnqn)
{
	return NULL;
}

struct spdk_nvmf_transport *
spdk_nvmf_tgt_get_transport(struct spdk_nvmf_tgt *tgt, enum spdk_nvme_transport_type trtype)
{
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ spdk_nvmf_transport_create(struct spdk_nvmf_tgt *tgt,
	return NULL;
}

struct spdk_nvmf_subsystem *
spdk_nvmf_tgt_find_subsystem(struct spdk_nvmf_tgt *tgt, const char *subnqn)
{
	return NULL;
}

struct spdk_nvmf_transport *
spdk_nvmf_tgt_get_transport(struct spdk_nvmf_tgt *tgt, enum spdk_nvme_transport_type trtype)
{