diff options
author | Fam Zheng <famz@redhat.com> | 2014-09-11 13:41:12 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-09-22 11:39:02 +0100 |
commit | 3391f5e51c4b55bf72fd33d9bc542a49114e48cd (patch) | |
tree | 96f6d6f6977058d8f05dbaa861abaab3a341db05 /arch_init.c | |
parent | f600ac19027e67dd73f1adad50a67a2cdb4f3218 (diff) |
thread-pool: Convert thread_pool_aiocb_info.cancel to cancel_async
The .cancel_async shares the same the first half with .cancel: try to
steal the request if not submitted yet. In this case set the elem to
THREAD_DONE status and ret to -ECANCELED, which means
thread_pool_completion_bh will call the cb with -ECANCELED.
If the request is already submitted, do nothing, as we know the normal
completion will happen in the future.
Testing code update:
Before, done_cb is only called if the request is already submitted by
thread pool. Now done_cb is always called, even before it is submitted,
because we emulate bdrv_aio_cancel with bdrv_aio_cancel_async. So also
update the test criteria accordingly.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'arch_init.c')
0 files changed, 0 insertions, 0 deletions