From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGBgn-0000UB-TR for qemu-devel@nongnu.org; Tue, 27 Jan 2015 14:20:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGBgj-0002wQ-Q5 for qemu-devel@nongnu.org; Tue, 27 Jan 2015 14:20:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGBgj-0002wK-9M for qemu-devel@nongnu.org; Tue, 27 Jan 2015 14:20:37 -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 t0RJKaLI016124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 27 Jan 2015 14:20:36 -0500 Message-ID: <54C7E503.9010903@redhat.com> Date: Tue, 27 Jan 2015 12:20:35 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422288204-29271-1-git-send-email-mreitz@redhat.com> <1422288204-29271-9-git-send-email-mreitz@redhat.com> In-Reply-To: <1422288204-29271-9-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GTocaMdM7xR5NRHRLt0qorKbhbACtHgOM" Subject: Re: [Qemu-devel] [PATCH 08/50] block/quorum: Implement bdrv_is_inserted() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , Markus Armbruster , Stefan Hajnoczi , john@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GTocaMdM7xR5NRHRLt0qorKbhbACtHgOM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/26/2015 09:02 AM, Max Reitz wrote: > bdrv_is_inserted() should be invoked recursively on the children of > quorum. >=20 > Signed-off-by: Max Reitz > --- > block/quorum.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) >=20 > diff --git a/block/quorum.c b/block/quorum.c > index 437b122..7811c4a 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -1064,6 +1064,20 @@ static void quorum_refresh_filename(BlockDriverS= tate *bs) > bs->full_open_options =3D opts; > } > =20 > +static int 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 0; If you convert the callback to return bool, this may need minor tweaks. But they don't affect correctness; Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GTocaMdM7xR5NRHRLt0qorKbhbACtHgOM 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/ iQEcBAEBCAAGBQJUx+UDAAoJEKeha0olJ0NqyJ4H/jboG9kIsFL8dc76df8FAydE lavSMigDmokNk9t1PHMbYCMtkGOVe5eHQPbuCNlLmQZ6hj9X3/vvaqXAdVqU1zPE kjW65vyRpNs8DgXjR/kL7mpns1+8YdYqDUees3f3oUcD9maScNwGE4QmaT1e+L8j al9C99LaElsy13kbEPC8W6iJNXM3ivqRidrgvZXCm1UuS0bgiYaOGA5eSrBhWkbP 73LsAA7tghxUKJHuPSwgOHWQU9zrGNr1HeNZewyg/OPN+nAj+PhbxHY/2sANE3LA AE443BsdljNd1dojPWUtB+ge/2mXwYbu0OF0rvo5Oc1xyJgp5mreoRuyoZpOHXY= =/Agq -----END PGP SIGNATURE----- --GTocaMdM7xR5NRHRLt0qorKbhbACtHgOM--