Commit 6da9e179 authored by Cunyin Chang's avatar Cunyin Chang Committed by Daniel Verkamp
Browse files

nvmf: move the virtual mode related code to the virtual.c.



Change-Id: Ia68ffdd2019adba3a37295ee455e93f8e0427fa2
Signed-off-by: default avatarCunyin Chang <cunyin.chang@intel.com>
parent fca35b7b
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -84,17 +84,7 @@ subsystem_delete_event(void *arg1, void *arg2)
static void
nvmf_tgt_delete_subsystem(struct nvmf_tgt_subsystem *app_subsys)
{
	struct spdk_nvmf_subsystem *subsystem = app_subsys->subsystem;
	struct spdk_event *event;
	int i;

	if (spdk_nvmf_subsystem_get_type(subsystem) == SPDK_NVMF_SUBTYPE_NVME &&
	    spdk_nvmf_subsystem_get_mode(subsystem) == NVMF_SUBSYSTEM_MODE_VIRTUAL) {
		for (i = 0; i < subsystem->dev.virt.ns_count; i++) {
			spdk_put_io_channel(subsystem->dev.virt.ch[i]);
			subsystem->dev.virt.ch[i] = NULL;
		}
	}

	/*
	 * Unregister the poller - this starts a chain of events that will eventually free
+8 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@

#include "spdk/bdev.h"
#include "spdk/endian.h"
#include "spdk/io_channel.h"
#include "spdk/nvme.h"
#include "spdk/nvmf_spec.h"
#include "spdk/trace.h"
@@ -528,9 +529,15 @@ nvmf_virtual_ctrlr_detach(struct spdk_nvmf_subsystem *subsystem)
	uint32_t i;

	for (i = 0; i < subsystem->dev.virt.ns_count; i++) {
		if (subsystem->dev.virt.ns_list[i]) {
			spdk_put_io_channel(subsystem->dev.virt.ch[i]);
			spdk_bdev_unclaim(subsystem->dev.virt.ns_list[i]);
			subsystem->dev.virt.ch[i] = NULL;
			subsystem->dev.virt.ns_list[i] = NULL;
		}
	}
	subsystem->dev.virt.ns_count = 0;
}

static void
nvmf_virtual_ctrlr_set_aer_callback(struct spdk_nvmf_subsystem *subsys)