L Tuesday 29 Oct 2013 à 18:21:57 (+0100), Max Reitz a écrit : > Am 28.10.2013 13:21, schrieb Benoît Canet: > > Le Friday 04 Oct 2013 à 16:35:18 (+0200), Max Reitz a écrit : > >> On 2013-10-02 14:39, Benoît Canet wrote: > >>> Signed-off-by: Benoit Canet <ben...@irqsave.net> > >>> --- > >>> block/quorum.c | 123 > >>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > >>> 1 file changed, 123 insertions(+) > >>> > >>> diff --git a/block/quorum.c b/block/quorum.c > >>> index 9557e61..b49e3c6 100644 > >>> --- a/block/quorum.c > >>> +++ b/block/quorum.c > >>> @@ -64,11 +64,134 @@ struct QuorumAIOCB { > >>> int vote_ret; > >>> }; > >>> +static void quorum_aio_cancel(BlockDriverAIOCB *blockacb) > >>> +{ > >>> + QuorumAIOCB *acb = container_of(blockacb, QuorumAIOCB, common); > >>> + bool finished = false; > >>> + > >>> + /* Wait for the request to finish */ > >>> + acb->finished = &finished; > >>> + while (!finished) { > >>> + qemu_aio_wait(); > >>> + } > >> Hm, wouldn't it be better to pass the cancel to the children? > >> > >> Max > > Hi Max, > > > > Hi don't understand how you would do this. > > > > Best regards > > > > Benoît > > I thought of calling bdrv_aio_cancel() on every aios[i].aiocb – I don't > know if that will work but it seems reasonable to me to try to cancel > all the operations quorum has initiated when the quorum operation itself > is requested to be canceled (instead of waiting for the spawned > operations to finish normally).
That makes sense. I will do this. Best regards Benoît > > Max