vbdev/unit: destroy bs_dev during unload
If there is no lvol on lvol store in destroy bs_dev in vbdev unit tests. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I5b4783c98bb1b6bba011118f46f708ad0f0fb222 Reviewed-on: https://review.gerrithub.io/382018 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
61b4258c56
commit
526d759a2d
@ -124,9 +124,15 @@ spdk_lvs_unload(struct spdk_lvol_store *lvs, spdk_lvs_op_complete cb_fn,
|
||||
void *cb_arg)
|
||||
{
|
||||
struct spdk_lvol_store_req *req = cb_arg;
|
||||
free(req);
|
||||
free(lvs);
|
||||
|
||||
g_lvol_store = NULL;
|
||||
free(lvs);
|
||||
|
||||
if (g_lvol == NULL)
|
||||
g_bs_dev->destroy(g_bs_dev);
|
||||
|
||||
if (cb_fn != NULL)
|
||||
cb_fn(req, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -505,6 +511,7 @@ ut_lvs_init(void)
|
||||
vbdev_lvs_destruct(lvs, lvol_store_op_complete, NULL);
|
||||
CU_ASSERT(g_lvserrno == 0);
|
||||
CU_ASSERT(g_lvol_store == NULL);
|
||||
CU_ASSERT(g_bs_dev == NULL);
|
||||
free(g_bs_dev);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user