mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
e551c999bc
commit
ca5fd113b8
24
block.c
24
block.c
|
@ -4640,22 +4640,18 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
|
||||||
|
|
||||||
void bdrv_aio_cancel(BlockDriverAIOCB *acb)
|
void bdrv_aio_cancel(BlockDriverAIOCB *acb)
|
||||||
{
|
{
|
||||||
if (acb->aiocb_info->cancel) {
|
qemu_aio_ref(acb);
|
||||||
acb->aiocb_info->cancel(acb);
|
bdrv_aio_cancel_async(acb);
|
||||||
} else {
|
while (acb->refcnt > 1) {
|
||||||
qemu_aio_ref(acb);
|
if (acb->aiocb_info->get_aio_context) {
|
||||||
bdrv_aio_cancel_async(acb);
|
aio_poll(acb->aiocb_info->get_aio_context(acb), true);
|
||||||
while (acb->refcnt > 1) {
|
} else if (acb->bs) {
|
||||||
if (acb->aiocb_info->get_aio_context) {
|
aio_poll(bdrv_get_aio_context(acb->bs), true);
|
||||||
aio_poll(acb->aiocb_info->get_aio_context(acb), true);
|
} else {
|
||||||
} else if (acb->bs) {
|
abort();
|
||||||
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
|
/* Async version of aio cancel. The caller is not blocked if the acb implements
|
||||||
|
|
|
@ -26,7 +26,6 @@ typedef struct BlockDriverAIOCB BlockDriverAIOCB;
|
||||||
typedef void BlockDriverCompletionFunc(void *opaque, int ret);
|
typedef void BlockDriverCompletionFunc(void *opaque, int ret);
|
||||||
|
|
||||||
typedef struct AIOCBInfo {
|
typedef struct AIOCBInfo {
|
||||||
void (*cancel)(BlockDriverAIOCB *acb);
|
|
||||||
void (*cancel_async)(BlockDriverAIOCB *acb);
|
void (*cancel_async)(BlockDriverAIOCB *acb);
|
||||||
AioContext *(*get_aio_context)(BlockDriverAIOCB *acb);
|
AioContext *(*get_aio_context)(BlockDriverAIOCB *acb);
|
||||||
size_t aiocb_size;
|
size_t aiocb_size;
|
||||||
|
|
Loading…
Reference in New Issue