From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0UXF-0001sM-5O for qemu-devel@nongnu.org; Thu, 04 Jun 2015 08:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0UXE-0006DQ-0h for qemu-devel@nongnu.org; Thu, 04 Jun 2015 08:46:13 -0400 Message-ID: <55704889.1060707@redhat.com> Date: Thu, 04 Jun 2015 06:46:01 -0600 From: Eric Blake MIME-Version: 1.0 References: <1433360659-1915-1-git-send-email-mreitz@redhat.com> <1433360659-1915-8-git-send-email-mreitz@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gVwTtmjex6UxCJwJ3hqFjbbdgFjbEXvR1" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , Max Reitz , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gVwTtmjex6UxCJwJ3hqFjbbdgFjbEXvR1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/04/2015 06:37 AM, Alberto Garcia wrote: > On Wed 03 Jun 2015 09:43:48 PM CEST, Max Reitz wrote: >> bdrv_is_inserted() should be invoked recursively on the children of >> quorum. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake >> --- >=20 >> +static bool quorum_is_inserted(BlockDriverState *bs) >> +{ >> + BDRVQuorumState *s =3D bs->opaque; >> + int i; >> + >> + for (i =3D 0; i < s->num_children; i++) { >> + if (!bdrv_is_inserted(s->bs[i])) { >> + return false; >> + } >> + } >> + >> + return true; >> +} >> + >=20 > I wonder if it can actually happen that only some of the BDS are > inserted :-? Probably not possible while having a working quorum. But if I understand the series correctly, there may be windows of time when building up or hot-swapping a child within a quorum where things are not yet consistent, but where the code can query the current state of the quorum, so it's better to be prepared for those windows. And while unlikely, it is possible to build up a quorum that includes host cdrom passthrough or other scenario where one child can independently fail to be inserted. Who knows - we may even take advantage of this in COLO checkpointing where an NBD child is not yet inserted. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gVwTtmjex6UxCJwJ3hqFjbbdgFjbEXvR1 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/ iQEcBAEBCAAGBQJVcEiJAAoJEKeha0olJ0NqbIMH/jXYALjsvqnet2zLiV9vV3Q6 HJ2YyHaIhR3melrbBtPd6i376MJZO16XN8Ib2ZSrbWIsaFhM8tc8L2gevR21hfGj wDleQa4V9XaFY2pN7ILUx4g9K2cz/KMkMZFFkGvqbwm/cySI7BGeZsyXKdO370OR ySA+mNlGZX5Z/NfH9gN7uBiMRxEMy07+V5JtxBBSt1DFu8EJXcHdBJ5rAWEA+zp2 KKR69qcouH/JhMBIvFtwf8CN5p+I/m/XN0TGY6wE42ILwEzNLK2RPeln0x+SIqQy ZaX/29Gwimf72vKFYGV6uOk+5jHpUkY+kxXXZok9uRuB8hlobj1oU0hWAUpTOgA= =vPUb -----END PGP SIGNATURE----- --gVwTtmjex6UxCJwJ3hqFjbbdgFjbEXvR1--