Re: [Qemu-devel] [RFC PATCH 4/9] linux-aio: Implement .cancel_async

2014-08-21 Thread Fam Zheng
On Thu, 08/21 17:31, Stefan Hajnoczi wrote: > On Thu, Aug 21, 2014 at 07:56:51PM +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_

Re: [Qemu-devel] [RFC PATCH 4/9] linux-aio: Implement .cancel_async

2014-08-21 Thread Stefan Hajnoczi
On Thu, Aug 21, 2014 at 07:56:51PM +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; > +stru

[Qemu-devel] [RFC PATCH 4/9] linux-aio: Implement .cancel_async

2014-08-21 Thread Fam Zheng
Just call io_cancel (2), if it fails, it means the request is not canceled, so the event loop will eventually call qemu_laio_process_completion. In qemu_laio_process_completion, change to call the cb unconditionally. It is required by .cancel_async, and also acceptable by .cancel. Signed-off-by: