From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4tOp-0008Er-Ln for qemu-devel@nongnu.org; Tue, 16 Jun 2015 12:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4tOm-0001V2-Em for qemu-devel@nongnu.org; Tue, 16 Jun 2015 12:07:43 -0400 Date: Tue, 16 Jun 2015 17:07:36 +0100 From: Stefan Hajnoczi Message-ID: <20150616160736.GD4958@stefanha-thinkpad.redhat.com> References: <1433215322-23529-1-git-send-email-famz@redhat.com> <1433215322-23529-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9dgjiU4MmWPVapMU" Content-Disposition: inline In-Reply-To: <1433215322-23529-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 02/13] block: Introduce bdrv_lock and bdrv_unlock API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Paolo Bonzini , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi --9dgjiU4MmWPVapMU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 02, 2015 at 11:21:51AM +0800, Fam Zheng wrote: > +/** > + * bdrv_lock: > + * > + * Begin a temporary exclusive accessing by locking the BDS. > + */ > +void bdrv_lock(BlockDriverState *bs); > + > +/** > + * bdrv_unlock: > + * > + * End a exclusive accessing. > + */ > +void bdrv_unlock(BlockDriverState *bs); This documentation is missing important points: 1. Does AioContext need to be held by the caller? (Yes) 2. Is this about thread safety? (No, it's about exclusive access to a BDS *within* the AioContext.) Maybe bdrv_begin_exclusive() and bdrv_end_exclusive() are clearer names? --9dgjiU4MmWPVapMU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVgEnIAAoJEJykq7OBq3PIAb8IAIUciom4VPfibL5NYPCuYOyM jF/r0MtmXJRCOAcwjtOA6U+rN/y9QPWZVvkK+SnhqNDtKS5TmQzx/1T4hWcS/awO SfJ5ITfNzyG9rjzMUnRaRT8uwPQdXknuXor7HBhJIjwiedE9+tiAchs1r4So/MM+ fM1POYh56SSLFgiYMSd5oH/LLEggrP/t9pst5+U34CWp/quCuVJP2AK9nnju8bgi lXaR+iSIM5nLlGSs3jfzRE/wO64gJyBPRwxkZ/Zt1SvoFDLzu+c8etGQC+FB8Z4D VqFqLNkuuZ1De7P0Ie+/FAsa7kJkb+2gcnW5ZGaqaTnHVrXR8+aoU1suK+0m2v8= =lyUe -----END PGP SIGNATURE----- --9dgjiU4MmWPVapMU--