vhost-blk: put bdev IO channel on hot remove

On hot remove, before closing bdev, put its IO channel.
If we don't do this bdev won't be destroyed until controller
is removed.

This fixes GitHub issue #401.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I92600c2f7136f56afd6593f663f2d2cf468a37dc

Reviewed-on: https://review.gerrithub.io/422258
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Maciej Szwed 2018-08-14 12:49:10 +02:00 committed by Jim Harris
parent e7c9f62046
commit 039a4c6cb0

View File

@ -374,6 +374,11 @@ no_bdev_vdev_worker(void *arg)
spdk_vhost_dev_used_signal(&bvdev->vdev);
if (bvdev->vdev.task_cnt == 0 && bvdev->bdev_io_channel) {
spdk_put_io_channel(bvdev->bdev_io_channel);
bvdev->bdev_io_channel = NULL;
}
return -1;
}