08de94d0dd
Vhost external events no longer do any asynchronous calls, they only lock the vhost mutex and directly call the provided function. The mutex encapsulation isn't worth the additional complexity of splitting each vdev-handling code into multiple functions, so we expose low-level APIs that should eventually replace external events entirely. Instead of: ``` static int do_something_cb(struct spdk_vhost_dev *vdev, void *arg) { struct my_data *ctx = arg; /* access the vdev and ctx */ free(ctx); } struct my_data *ctx = calloc(...); rc = spdk_vhost_call_external_event("my_vdev", do_something_cb, ctx); if (rc != 0) { /* err handling */ } ``` We can now do just: ``` spdk_vhost_lock(); vdev = spdk_vhost_dev_find("my_vdev"); if (vdev == NULL) { /* err handling */ } /* access the vdev any context data */ spdk_vhost_unlock(); ``` Change-Id: I06e1e149d6dd006720b021d3bef8d9b7bfaeceaa Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/440377 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> |
||
---|---|---|
.. | ||
linux | ||
spdk | ||
spdk_internal | ||
Makefile |