On Wed, Aug 27, 2014 at 10:49:12AM +0800, Fam Zheng wrote: > @@ -110,6 +109,22 @@ static void qemu_laio_completion_cb(EventNotifier *e) > } > } > > +static void laio_cancel_async(BlockDriverAIOCB *blockacb) > +{ > + struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb; > + struct io_event event; > + int ret; > + > + ret = io_cancel(laiocb->ctx->ctx, &laiocb->iocb, &event); > + laiocb->ret = -ECANCELED; > + if (!ret) { > + /* iocb is not cancelled, cb will be called by the event loop later > */ > + return; > + }
This comment doesn't make sense, io_cancel() returns 0 on success so it has been cancelled. We need to call the completion callback! Stefan
pgpXd0rTWo3sV.pgp
Description: PGP signature