From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKSfr-0000Qg-Cd for qemu-devel@nongnu.org; Thu, 21 Aug 2014 09:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKSfl-0002Eo-8X for qemu-devel@nongnu.org; Thu, 21 Aug 2014 09:45:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKSfk-0002Eh-W6 for qemu-devel@nongnu.org; Thu, 21 Aug 2014 09:45:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7LDj0nm020076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 21 Aug 2014 09:45:00 -0400 Date: Thu, 21 Aug 2014 14:44:58 +0100 From: Stefan Hajnoczi Message-ID: <20140821134458.GC22844@stefanha-thinkpad.redhat.com> References: <1408622216-9578-1-git-send-email-famz@redhat.com> <1408622216-9578-2-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gr/z0/N6AeWAPJVB" Content-Disposition: inline In-Reply-To: <1408622216-9578-2-git-send-email-famz@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: Fam Zheng Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org --gr/z0/N6AeWAPJVB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 21, 2014 at 07:56:48PM +0800, Fam Zheng wrote: > +/* Async version of aio cancel. The caller is not blocked if the acb implements > + * cancel_async, otherwise fall back to bdrv_aio_cancel. In both cases, acb->cb > + * is guarenteed to be called, before or after function returns. */ > +void bdrv_aio_cancel_async(BlockDriverAIOCB *acb) > +{ > + if (acb->aiocb_info->cancel_async) { > + acb->aiocb_info->cancel_async(acb); > + } else { > + BlockDriverAIOCB *save = g_new(BlockDriverAIOCB, 1); Please don't create a dummy BlockDriverAIOCB. It makes the code confusing because all other BlockDriverAIOCBs in QEMU are allocated with qemu_aio_get() and behave in a certain way. This is not really a BlockDriverAIOCB, it's just a struct to stash the old cb/opaque in. --gr/z0/N6AeWAPJVB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT9ffaAAoJEJykq7OBq3PIUIYH/ibWCJYfWeGbAqr2SxDrY/8p rO+1LJUEu/aSq+pt7VA75veYUnFpsn6sB3s4DC5PGT+pb2Mqs10ALU0MbfYsrNoK ffRliXJkxvzydodk11uuWp+Izzss3IZXB5DbICRY6hV0V/plXhN4s8jp01DUjKAS 8Au6dQpinRFpYp36AoNBPo9BQW8n8PdVYq6jAu7lNSNrhKfAJpVTxzrCTxWJBhOs XgtlD1azj7G3tul/vMB5d2AA7j6lW/Lc58p97M/zLauUG8TsabbgHheAXDDWUDG8 cuJLYL52l5GooCIm8wZPfnlwpBnK4RU4Te70E2YEcAYkKYaA5NsJeFgHHTjHqVo= =K6A1 -----END PGP SIGNATURE----- --gr/z0/N6AeWAPJVB--