From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKlI6-00029D-0n for qemu-devel@nongnu.org; Fri, 22 Aug 2014 05:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKlHz-0005se-SQ for qemu-devel@nongnu.org; Fri, 22 Aug 2014 05:37:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKlHz-0005sX-LT for qemu-devel@nongnu.org; Fri, 22 Aug 2014 05:37:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7M9bgHi003415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 22 Aug 2014 05:37:42 -0400 Date: Fri, 22 Aug 2014 17:37:58 +0800 From: Fam Zheng Message-ID: <20140822093758.GA24795@T430.nay.redhat.com> References: <1408622216-9578-1-git-send-email-famz@redhat.com> <1408622216-9578-2-git-send-email-famz@redhat.com> <53F5E289.8050703@redhat.com> <20140822012336.GB3410@T430.redhat.com> <53F6FBFF.1010504@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53F6FBFF.1010504@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 1/9] block: Add bdrv_aio_cancel_async List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Fri, 08/22 10:14, Paolo Bonzini wrote: > Il 22/08/2014 03:23, Fam Zheng ha scritto: > > What about we save cb and opaque locally, and set acb->cb to a nop. When cancel > > is done we can call the original cb? > > That might work but needs some auditing. Right now the AIOCB is still > valid when the callback is called, and this would be changed. > > Also, having different semantics for cancellation vs. completion would > be painful. > Exactly. I'd rather not change the contract then. Alternatively, we may add a refcnt field to BlockDriverAioCB and grab one before calling .cancel, so the qemu_aio_release will not free it. Fam