From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkwSa-0000kJ-9Q for qemu-devel@nongnu.org; Thu, 15 May 2014 10:16:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkwSV-0001s6-C9 for qemu-devel@nongnu.org; Thu, 15 May 2014 10:16:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkwSV-0001s0-45 for qemu-devel@nongnu.org; Thu, 15 May 2014 10:16:31 -0400 Message-ID: <5374CC3B.8090007@redhat.com> Date: Thu, 15 May 2014 08:16:27 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="R1PiwrXefJ9cdQ9HiAscftmBFQ9IO2B1A" Subject: Re: [Qemu-devel] [PATCH 2/5] block: add helper function to determine if a BDS is in a chain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , qemu-devel@nongnu.org Cc: kwolf@redhat.com, benoit.canet@irqsave.net, pkrempa@redhat.com, famz@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --R1PiwrXefJ9cdQ9HiAscftmBFQ9IO2B1A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/14/2014 09:20 PM, Jeff Cody wrote: > This is a small helper function, to determine if 'base' is in the > chain of BlockDriverState 'top'. It returns true if it is in the chain= , > and false otherwise. >=20 > If either argument is NULL, it will also return false. >=20 > Signed-off-by: Jeff Cody > --- > block.c | 9 +++++++++ > include/block/block.h | 1 + > 2 files changed, 10 insertions(+) >=20 > =20 > +bool bdrv_is_in_chain(BlockDriverState *top, BlockDriverState *base) No doc comments inline, and not everyone has the commit message handy. Which means someone trying to learn what this command does has to read the function. Maybe copy the commit message into code comments as well. Bikeshedding: If I'm reading code, and see bdrv_is_in_chain(a, b), my first inclination would be to read that as "return true if node a is in chain b". But if I were to see bdrv_chain_contains(a, b), I would parse that as "return true if chain a contains node b". I think you either want to swap argument order, or rename the function. The function itself looks useful, though, once we agree on the naming. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --R1PiwrXefJ9cdQ9HiAscftmBFQ9IO2B1A 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/ iQEcBAEBCAAGBQJTdMw7AAoJEKeha0olJ0NqFYQIAIcx1OMujVd6IYjZurX3sBZX n16pybsmyls75RyMnJzUw8icNilB3pmm+1hxp2cGpQiikkuJ5WGUf403N+Hy3d2H /bSuFrNuK7hHb2l8ORTux83eo02ouleu2mgpzOVinGl77Jn1wC8CGzzwoY+ZoBQo DiK3ODXuNJ/SsATBHXh2k8LI9gO/dc0fszKg1UXZ1zLzsl0exjtdTRyzHWW5JY5O QvONId4l0HLkvPCwHnKzueC0EYERGovGsyHDOgoChhgSyZJC1nVyV39GwCoD3zwT AgFj8Sf6N+BE5t2gvpMWZx0Lifkj5PD+RvL0xo6C9nzXccMHTvDvi7/BUlsaH2g= =ayG2 -----END PGP SIGNATURE----- --R1PiwrXefJ9cdQ9HiAscftmBFQ9IO2B1A--