Currently when a vhost-scsi controller is removed, it calls spdk_vhost_scsi_dev_remove_tgt on all remaining targets, and then immediately calls vhost_dev_unregister. But this path goes into vhost_user_dev_unregister which immediately returns with error if there are any pending async operations - and there are since scsi_dev_remove_tgt is asynchronous. So instead add the vhost_dev_unregister call to remove_scsi_tgt, so that the unregister only happens after the last ref goes away. This requires changing vhost_fini() to no longer assume that spdk_vhost_dev_remove() will immediately unregister the device, since it now happens asynchronously. Previously vhost_fini() was making this assumption erroneously - it would call g_fini_cb without actually checking that the devices had been unregistered. Because of that incorrect assumption, we need to do both the vhost and vhost-scsi changes in the same patch. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I9577901266975447f9acfe53475221113f02fea3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15510 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> |
||
---|---|---|
.. | ||
Makefile | ||
rte_vhost_user.c | ||
spdk_vhost.map | ||
vhost_blk.c | ||
vhost_internal.h | ||
vhost_rpc.c | ||
vhost_scsi.c | ||
vhost.c |