From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyNb8-0001Tl-FZ for qemu-devel@nongnu.org; Fri, 29 May 2015 12:57:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyNb7-00015H-Cf for qemu-devel@nongnu.org; Fri, 29 May 2015 12:57:30 -0400 Message-ID: <55689A6B.6030509@redhat.com> Date: Fri, 29 May 2015 10:57:15 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432896805-23867-1-git-send-email-famz@redhat.com> <1432896805-23867-3-git-send-email-famz@redhat.com> In-Reply-To: <1432896805-23867-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DdHTdbbMv3iL78CNqo8jSHSuCeXSBS4BH" Subject: Re: [Qemu-devel] [RFC PATCH 02/12] block: Introduce bdrv_lock and bdrv_unlock API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , fam@euphon.net, qemu-block@nongnu.org, Jeff Cody , Stefan Hajnoczi , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DdHTdbbMv3iL78CNqo8jSHSuCeXSBS4BH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/29/2015 04:53 AM, Fam Zheng wrote: > For various purposes, BDS users call bdrv_drain or bdrv_drain_all to ma= ke sure > there are no pending requests duringA a series of operations on the BDS= =2E But in s/duringA/during/ > the middle of operations, the caller may 1) yield from a coroutine (mir= ror_run); > 2) defer the next part of work to a BH (mirror_run); 3) call nested aio= _poll > (qmp_transaction); etc.. >=20 > This lock/unlock API is introduced to help assure above complications w= on't > spoil the purpose of the bdrv_drain(): bdrv_lock should help quiesce ot= her > readers and writers in the beginning of such operations, and bdrv_unloc= k should > resume the blocked requests. >=20 > A notifier list is added to allow devices to cooperate with the lock an= d pause > themselves, for example, by not processing more requests on the NBD exp= ort. >=20 > Signed-off-by: Fam Zheng > --- > block.c | 10 +++++++ > block/io.c | 69 +++++++++++++++++++++++++++++++++++++++= ++++++++ > include/block/block.h | 39 +++++++++++++++++++++++++++ > include/block/block_int.h | 5 ++++ > 4 files changed, 123 insertions(+) >=20 I'll leave the technical review on this series to those more familiar with coroutines. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DdHTdbbMv3iL78CNqo8jSHSuCeXSBS4BH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVaJprAAoJEKeha0olJ0Nq+p4H/2OuoPAE4axWOyJP+H+Elgpv sA4kddbqvvP/hK9nMl5PHqS0CUmS3TzGjgEOnbhAjbXgb5TXLpa/2lrtSS8M3TbO Gjd8U3MDt4nQzbngAqFIgrAGNKmxhxL2npSIrA4Oyzb529+Sqts/ft7qs/Ukc1/U XIQQ36Pa3YEy7Eg1OXSZflgFJF7fdbvln95OG04OwvkcqO0CII0HWtw0KetSyaHi jhVSwfs0/0Dimbowec9GYej5WF91me2EGzgJEROQzGBS7U4dB3x1EI3PjCErvemD kKWyUNXsBXUQr0D7cpbT1YLxOHGKqwX99TKF4HjhvX9JpNf/C9U3yituBNzjXbk= =ouLV -----END PGP SIGNATURE----- --DdHTdbbMv3iL78CNqo8jSHSuCeXSBS4BH--