Spdk/test/unit/lib/bdev/nvme
Shuhei Matsumoto 67a03bc73a ut/bdev_nvme: spdk_nvme_detach() stub calls ut_detach_ctrlr() if ctrlr is attached by ut_attach_ctrlr()
bdev_nvme_delete() calls spdk_nvme_detach() in the end. However,
previously spdk_nvme_detach() stub did nothing and ut_detach_ctrlr()
was called separately if ctrlr wass attached by ut_detach_ctrlr().

This was to differentiate the two cases, ctrlr is statically assigned
or dynamically attached by ut_detach_ctrlr().

This might be a little confusing. Hence by adding a flag, attached,
to ctrlr, merge ut_detach_ctrlr() into spdk_nvme_detach(), and remove
ut_detach_ctrlr() calls.

Besides, change one SPDK_CU_ASSERT_FATAL to return NULL because the
other cases do that and the callers for ut_attach_ctrlr() already have
SPDK_CU_ASSERT_FATAL.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2a73f57c6031819d3ae441a6874127ff5d53fc04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7311
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-12 09:51:03 +00:00
..
bdev_nvme.c ut/bdev_nvme: spdk_nvme_detach() stub calls ut_detach_ctrlr() if ctrlr is attached by ut_attach_ctrlr() 2021-04-12 09:51:03 +00:00
bdev_ocssd.c bdev/nvme: Move nvme_ctrlr_depopulate_namespace_done() to common.c 2021-04-08 16:10:26 +00:00
Makefile ut/bdev_nvme: Create framework and add test case to create nvme_bdev_ctrlr 2021-02-18 13:36:33 +00:00