test/app: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async()
Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() with a local variable detach_ctx to detach multiple controllers. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I43428a41df2b6f26b62cf03990d35add9a3663d6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4440 Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
0a903c91ac
commit
7a85c283d9
@ -537,12 +537,17 @@ static void
|
||||
free_controllers(void)
|
||||
{
|
||||
struct nvme_fuzz_ctrlr *ctrlr, *tmp;
|
||||
struct spdk_nvme_detach_ctx *detach_ctx = NULL;
|
||||
|
||||
TAILQ_FOREACH_SAFE(ctrlr, &g_ctrlr_list, tailq, tmp) {
|
||||
TAILQ_REMOVE(&g_ctrlr_list, ctrlr, tailq);
|
||||
spdk_nvme_detach(ctrlr->ctrlr);
|
||||
spdk_nvme_detach_async(ctrlr->ctrlr, &detach_ctx);
|
||||
free(ctrlr);
|
||||
}
|
||||
|
||||
while (detach_ctx && spdk_nvme_detach_poll_async(detach_ctx) == -EAGAIN) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -52,12 +52,17 @@ static void
|
||||
cleanup(void)
|
||||
{
|
||||
struct ctrlr_entry *ctrlr_entry, *tmp;
|
||||
struct spdk_nvme_detach_ctx *detach_ctx = NULL;
|
||||
|
||||
TAILQ_FOREACH_SAFE(ctrlr_entry, &g_controllers, link, tmp) {
|
||||
TAILQ_REMOVE(&g_controllers, ctrlr_entry, link);
|
||||
spdk_nvme_detach(ctrlr_entry->ctrlr);
|
||||
spdk_nvme_detach_async(ctrlr_entry->ctrlr, &detach_ctx);
|
||||
free(ctrlr_entry);
|
||||
}
|
||||
|
||||
while (detach_ctx && spdk_nvme_detach_poll_async(detach_ctx) == -EAGAIN) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user