The Friday 05 Sep 2014 à 18:55:51 (+0800), Fam Zheng wrote : > On Thu, 09/04 17:21, Benoît Canet wrote: > > The Wednesday 03 Sep 2014 à 19:23:39 (+0800), Fam Zheng wrote : > > > All the difference is that the old .cancel doesn't call cb, but > > > .cancel_async does. > > > > > > Signed-off-by: Fam Zheng <f...@redhat.com> > > > --- > > > block.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/block.c b/block.c > > > index 4aa1bd7..b7253af 100644 > > > --- a/block.c > > > +++ b/block.c > > > @@ -4679,6 +4679,9 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB > > > *blockacb) > > > { > > > BlockDriverAIOCBSync *acb = > > > container_of(blockacb, BlockDriverAIOCBSync, common); > > > + > > > + acb->ret = -ECANCELED; > > > + acb->common.cb(acb->common.opaque, acb->ret); > > > qemu_bh_delete(acb->bh); > > > acb->bh = NULL; > > > qemu_aio_release(acb); > > > @@ -4686,7 +4689,7 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB > > > *blockacb) > > > > > > static const AIOCBInfo bdrv_em_aiocb_info = { > > > .aiocb_size = sizeof(BlockDriverAIOCBSync), > > > - .cancel = bdrv_aio_cancel_em, > > > + .cancel_async = bdrv_aio_cancel_em, > > > }; > > > > Note from an AIO noob. Could we explain somewhere in the block layer what > > the _em suffix means ? > > I didn't write these functions but I think it means "emulation".
Thanks Best regards Benoît > > Fam