From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGbLp-0000PE-Us for qemu-devel@nongnu.org; Wed, 28 Jan 2015 17:44:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGbLk-0006xt-Sj for qemu-devel@nongnu.org; Wed, 28 Jan 2015 17:44:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGbLk-0006xj-Ka for qemu-devel@nongnu.org; Wed, 28 Jan 2015 17:44:40 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SMidwJ017012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 17:44:39 -0500 Message-ID: <54C96656.30206@redhat.com> Date: Wed, 28 Jan 2015 15:44:38 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422300468-16216-1-git-send-email-mreitz@redhat.com> <1422300468-16216-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1422300468-16216-5-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K1kNgJnmEEc7xqqer75jjKlBH8L0tvMo2" Subject: Re: [Qemu-devel] [PATCH 04/21] block: Add bdrv_close_all() handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K1kNgJnmEEc7xqqer75jjKlBH8L0tvMo2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/26/2015 12:27 PM, Max Reitz wrote: > Every time a reference to a BlockBackend is taken, a notifier for > bdrv_close_all() has to be deposited so the reference holder can > relinquish its reference when bdrv_close_all() is called. That notifier= > should be revoked on a bdrv_unref() call. >=20 In addition to the design question about whether NBD exports should be their own new BB, > @@ -198,8 +207,12 @@ void blk_ref(BlockBackend *blk) > * If this drops it to zero, destroy @blk. > * For convenience, do nothing if @blk is null. > */ > -void blk_unref(BlockBackend *blk) > +void blk_unref(BlockBackend *blk, Notifier *close_all_notifier) > { > + if (close_all_notifier) { > + notifier_remove(close_all_notifier); > + } > + > if (blk) { Does removing a notifier when blk is NULL make sense? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --K1kNgJnmEEc7xqqer75jjKlBH8L0tvMo2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJUyWZWAAoJEKeha0olJ0NqTdkH/j0ITsLmHk7YMuc4Yar/v2Wh vlhODgWVClBZxxqNCk8Lu7OuYqI3HyS4Oc4t6LF6LoK9/3P2i5MNEfYGmy26G61A Y7DMfXxfX/P4JWcyKKITSepLJ8VVGf1i0pYa4hAdomwpKqZeM2MjLfP09RIBtCqb Wl81WkvJWBbMluj352W2prAKT24VDMOLAsrM9YmPyBKXEcp8y7F1ZYu0eCZMiPxV gS+xImb16+MvOO4X2CAGsvIVLfmQu1E1AfJcLkSgoHbMVB2FluOBVxx4TPqFjqvu U3qSaKy7qtV2/N1mq+ISbk47VUyLMnkAAwMK6eJVMj+ACIr0dsCgCbkJcHKUcoA= =w3a7 -----END PGP SIGNATURE----- --K1kNgJnmEEc7xqqer75jjKlBH8L0tvMo2--