From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPLjr-0006Gz-U9 for qemu-devel@nongnu.org; Wed, 03 Sep 2014 21:21:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPLjl-0002kb-Oz for qemu-devel@nongnu.org; Wed, 03 Sep 2014 21:21:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPLjl-0002jg-Hs for qemu-devel@nongnu.org; Wed, 03 Sep 2014 21:21:21 -0400 Date: Thu, 4 Sep 2014 09:20:59 +0800 From: Fam Zheng Message-ID: <20140904012059.GC3760@T430.nay.redhat.com> References: <1409743435-21155-1-git-send-email-famz@redhat.com> <1409743435-21155-5-git-send-email-famz@redhat.com> <5406FB57.7070900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5406FB57.7070900@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 04/20] block: Convert bdrv_em_aiocb_info.cancel to .cancel_async List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Chrysostomos Nanakos , Stefan Hajnoczi , Peter Lieven , qemu-devel@nongnu.org, Ronnie Sahlberg , Liu Yuan , Josh Durgin , MORITA Kazutaka , Benoit Canet On Wed, 09/03 13:28, Paolo Bonzini wrote: > Il 03/09/2014 13:23, Fam Zheng ha scritto: > > All the difference is that the old .cancel doesn't call cb, but > > .cancel_async does. > > This requires auditing all callbacks though, doesn't it? Or at least > adding an > > if (ret == -ECANCELED) { > return; > } > > at the beginning. You are right, this is an unexpected error code for ide at least. Fam > > Paolo > > > Signed-off-by: Fam Zheng > > --- > > 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, > > }; > > > > static void bdrv_aio_bh_cb(void *opaque) > > >