From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxzRr-0002RR-Od for qemu-devel@nongnu.org; Thu, 28 May 2015 11:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxzRm-000245-2K for qemu-devel@nongnu.org; Thu, 28 May 2015 11:10:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxzRl-00023y-RV for qemu-devel@nongnu.org; Thu, 28 May 2015 11:10:14 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7812037FF68 for ; Thu, 28 May 2015 15:10:13 +0000 (UTC) Message-ID: <55672FCF.4090204@redhat.com> Date: Thu, 28 May 2015 09:10:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432815695-31687-1-git-send-email-armbru@redhat.com> <1432815695-31687-5-git-send-email-armbru@redhat.com> In-Reply-To: <1432815695-31687-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Mj4ck37KC2Qw8G63vuEpWdC2fGxGuPSAh" Subject: Re: [Qemu-devel] [PATCH 4/9] QemuOpts: Drop qemu_opts_foreach() parameter abort_on_failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Mj4ck37KC2Qw8G63vuEpWdC2fGxGuPSAh Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/28/2015 06:21 AM, Markus Armbruster wrote: > When the argument is non-zero, qemus_opt_foreach() stops on callback s/qemus_opt/qemu_opts/ > returning non-zero, and returns that value. >=20 > When the argument is zero, it doesn't stop, and returns the bit-wise > inclusive or of all the return values. Funky :) >=20 > The callers that pass zero could just as well pass one, because their > callbacks can't return anything but zero: >=20 > * qemu_add_globals()'s callback qdev_add_one_global() >=20 > * qemu_config_write()'s callback config_write_opts() >=20 > * main()'s callbacks default_driver_check(), drive_enable_snapshot(), > vnc_init_func() >=20 > Drop the parameter, and always stop. I had a hunch you might be getting to this point, just from reading the earlier patches :) >=20 > Signed-off-by: Markus Armbruster > --- > block/blkdebug.c | 4 ++-- > hw/core/qdev-properties-system.c | 2 +- > include/qemu/option.h | 4 ++-- > net/net.c | 5 +++-- > net/vhost-user.c | 2 +- > numa.c | 3 +-- > tpm.c | 3 +-- > util/qemu-config.c | 2 +- > util/qemu-option.c | 21 ++++++++++++++------- > vl.c | 35 ++++++++++++++++++--------------= --- > 10 files changed, 44 insertions(+), 37 deletions(-) >=20 > +++ b/net/vhost-user.c > @@ -240,7 +240,7 @@ int net_init_vhost_user(const NetClientOptions *opt= s, const char *name, > =20 > /* verify net frontend */ > if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_ne= t, > - (char *)name, true) =3D=3D -1) { > + (char *)name)) { Also evidence that we weren't clear on 'int' vs. 'bool' on the parameter's usage, so getting rid of it is indeed an improvement. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Mj4ck37KC2Qw8G63vuEpWdC2fGxGuPSAh 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/ iQEcBAEBCAAGBQJVZy/PAAoJEKeha0olJ0NqHmYIAIhq/cm0FF5z/jiN52k//cjN qZzKNb3Y45d2DgWDCj8hgB1xpOUWdGzuqLcfyBD1TWZUqKLSPON19AvWVb9YgmyH Is8+t51hWcsepx9pukF2h8w8v5pr2CpWW56keoeHanBPs1xjnFWym9zut++YwdQv seZI8e1K3soR8Z8jXFnAVfhK4Poacl9DgBLbppwut4+zc8Q0Ttq473KASp1wjwbV 51aQJpmhozj0TDxlcsQucugtmcYPonJs/Tj0p7/tS+0blK+r9JZx5D+PBkT4NMSm LJjW5LEHizVnzFA1iNniY1dvasIE+jz2stfW2ZeuuIJTGjVmbslNRjGo+BlPKZc= =DsHV -----END PGP SIGNATURE----- --Mj4ck37KC2Qw8G63vuEpWdC2fGxGuPSAh--