vhost: don't abort on event timeout

A single timeout error message is printed on the
screen already, so the user knows about the
timeout. Instead of aborting the app here, wait
endlessly for the event to complete. User
can kill the app any time if he wants to.

Change-Id: Ie1853e27b277d654a8e1099866d120f7a51638ba
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381075
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-03 09:05:10 +02:00 committed by Daniel Verkamp
parent 9df2ea9c27
commit ae19c072e8
2 changed files with 2 additions and 5 deletions

View File

@ -637,8 +637,8 @@ spdk_vhost_event_send(struct spdk_vhost_dev *vdev, spdk_vhost_event_fn cb_fn,
rc = sem_timedwait(&ev_ctx.sem, &timeout);
if (rc != 0) {
SPDK_ERRLOG("Timout waiting for event: %s.\n", errmsg);
abort();
SPDK_ERRLOG("Timeout waiting for event: %s.\n", errmsg);
sem_wait(&ev_ctx.sem);
}
sem_destroy(&ev_ctx.sem);

View File

@ -91,9 +91,6 @@ struct spdk_vhost_dev_backend {
* The first param is struct spdk_vhost_dev *.
* The second one is event context that has to be
* passed to spdk_vhost_dev_backend_event_done().
* If spdk_vhost_dev_backend_event_done isn't called
* within an arbitrary limit of 3 seconds, these
* callbacks will time out.
*/
spdk_vhost_event_fn start_device;
spdk_vhost_event_fn stop_device;