From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Wwt-0001Fv-M2 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 12:09:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Wwq-0005GR-TR for qemu-devel@nongnu.org; Mon, 15 Jun 2015 12:09:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Wwq-0005GL-LA for qemu-devel@nongnu.org; Mon, 15 Jun 2015 12:09:20 -0400 Message-ID: <557EF8AA.60802@redhat.com> Date: Mon, 15 Jun 2015 10:09:14 -0600 From: Eric Blake MIME-Version: 1.0 References: <1434205258-1932-1-git-send-email-armbru@redhat.com> <1434205258-1932-6-git-send-email-armbru@redhat.com> In-Reply-To: <1434205258-1932-6-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="it3fGMq4uD9RgfL7M38R563ksV0RthVOW" Subject: Re: [Qemu-devel] [PATCH 05/11] qerror: Clean up QERR_ macros to expand into a single string List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --it3fGMq4uD9RgfL7M38R563ksV0RthVOW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/13/2015 08:20 AM, Markus Armbruster wrote: > These macros expand into error class enumeration constant, comma, > string. Unclean. Has been that way since commit 13f59ae. >=20 > The error class is always ERROR_CLASS_GENERIC_ERROR since the previous > commit. >=20 > Clean up as follows: >=20 > * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and > delete it from the QERR_ macro. No change after preprocessing. >=20 > * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into > error_setg(...). Again, no change after preprocessing. Were these conversions done via coccinelle? If so, it would be nice to mention the script used in the commit message. But that doesn't affect the correctness of the patch itself. >=20 > Signed-off-by: Markus Armbruster > --- > util/qemu-option.c | 22 ++++++++------ > 53 files changed, 362 insertions(+), 358 deletions(-) Close to 1:1 lineup; difference is due to altered line wraps in a few spo= ts. >=20 > diff --git a/backends/rng-egd.c b/backends/rng-egd.c > index 849bd7a..225221e 100644 > --- a/backends/rng-egd.c > +++ b/backends/rng-egd.c > @@ -140,8 +140,8 @@ static void rng_egd_opened(RngBackend *b, Error **e= rrp) > RngEgd *s =3D RNG_EGD(b); > =20 > if (s->chr_name =3D=3D NULL) { > - error_set(errp, QERR_INVALID_PARAMETER_VALUE, > - "chardev", "a valid character device"); > + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "chardev", > + "a valid character device"); Interesting line rewrap. > +++ b/backends/rng-random.c > @@ -74,8 +74,8 @@ static void rng_random_opened(RngBackend *b, Error **= errp) > RndRandom *s =3D RNG_RANDOM(b); > =20 > if (s->filename =3D=3D NULL) { > - error_set(errp, QERR_INVALID_PARAMETER_VALUE, > - "filename", "a valid filename"); > + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "filename", > + "a valid filename"); and again > +++ b/block/quorum.c > @@ -800,8 +800,8 @@ static int quorum_valid_threshold(int threshold, in= t num_children, Error **errp) > { > =20 > if (threshold < 1) { > - error_set(errp, QERR_INVALID_PARAMETER_VALUE, > - "vote-threshold", "value >=3D 1"); > + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "vote-threshold= ", > + "value >=3D 1"); looks like there are several of them. They don't hurt, so I'll quit pointing them out. > =20 > #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ > - ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" P= RId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" > + "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64= ", maximum: %" PRId64 ")" Still a long line; worth wrapping with another \ mid-string? > +++ b/tpm.c > @@ -140,20 +140,22 @@ static int configure_tpm(QemuOpts *opts) > =20 > id =3D qemu_opts_id(opts); > if (id =3D=3D NULL) { > - qerror_report(QERR_MISSING_PARAMETER, "id"); > + qerror_report(ERROR_CLASS_GENERIC_ERROR, QERR_MISSING_PARAMETE= R, "id"); > return 1; Not quite the same s/error_set/error_setg/ change as everywhere else, but still correct. There may be additional merge conflicts depending on timing of getting this in, but it is mechanical resolution, and the sooner we get this in, the better. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --it3fGMq4uD9RgfL7M38R563ksV0RthVOW 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/ iQEcBAEBCAAGBQJVfviqAAoJEKeha0olJ0Nq/0YIAIjXwZF6sWQgw5cMz7ntg6hc 3GZRP5PgbTNFjDvi5e3b98a0/e5gkeeL6gbz1NHErOVDrOUeZMZ6+sBJl/xFUgam mQUPXuRo92/GstB7nhgoS87l7L4y7MCfwCR0jRy5TvrVymC/9C8+9GU1est+CQ2F PZz47H+/zFyRzPMGq04BbAPqS6I2g+SwPw7EKm7KQA6IcoceklDIagzhZKNU8hCq 62Fp8aZ2BHfcZgXXeT11/cyMIlRycVe/YgArnTMjS7NCtIhUuwFskoflhixpdkoG rklx31SiVK6sL36GOHTlP44o/efi1p8hiLiJDIRTAFwFoZ1efjRSKgg7mqYCdKk= =b18T -----END PGP SIGNATURE----- --it3fGMq4uD9RgfL7M38R563ksV0RthVOW--