aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-11 13:41:27 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-09-22 11:39:16 +0100
commitca5fd113b8ae5898853a757e06cb8d8a0c5e5d85 (patch)
tree020198549da77af2ddc19954f38799aadfa406f1 /block.c
parente551c999bcca1f29742741033853651f6ea88479 (diff)
downloadqemu-ca5fd113b8ae5898853a757e06cb8d8a0c5e5d85.zip
qemu-ca5fd113b8ae5898853a757e06cb8d8a0c5e5d85.tar.gz
qemu-ca5fd113b8ae5898853a757e06cb8d8a0c5e5d85.tar.bz2
block: Drop AIOCBInfo.cancel
Now that all the implementations are converted to asynchronous version and we can emulate synchronous cancellation with it. Let's drop the unused member. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/block.c b/block.c
index 45d3a5b..3a3648d 100644
--- a/block.c
+++ b/block.c
@@ -4640,22 +4640,18 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
void bdrv_aio_cancel(BlockDriverAIOCB *acb)
{
- if (acb->aiocb_info->cancel) {
- acb->aiocb_info->cancel(acb);
- } else {
- qemu_aio_ref(acb);
- bdrv_aio_cancel_async(acb);
- while (acb->refcnt > 1) {
- if (acb->aiocb_info->get_aio_context) {
- aio_poll(acb->aiocb_info->get_aio_context(acb), true);
- } else if (acb->bs) {
- aio_poll(bdrv_get_aio_context(acb->bs), true);
- } else {
- abort();
- }
+ qemu_aio_ref(acb);
+ bdrv_aio_cancel_async(acb);
+ while (acb->refcnt > 1) {
+ if (acb->aiocb_info->get_aio_context) {
+ aio_poll(acb->aiocb_info->get_aio_context(acb), true);
+ } else if (acb->bs) {
+ aio_poll(bdrv_get_aio_context(acb->bs), true);
+ } else {
+ abort();
}
- qemu_aio_release(acb);
}
+ qemu_aio_release(acb);
}
/* Async version of aio cancel. The caller is not blocked if the acb implements