From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avRLi-0000XI-0X for qemu-devel@nongnu.org; Wed, 27 Apr 2016 11:25:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avRLe-0005qe-02 for qemu-devel@nongnu.org; Wed, 27 Apr 2016 11:25:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avRLd-0005qZ-Oi for qemu-devel@nongnu.org; Wed, 27 Apr 2016 11:25:53 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72A3763141 for ; Wed, 27 Apr 2016 15:25:53 +0000 (UTC) References: <1461767349-15329-1-git-send-email-armbru@redhat.com> <1461767349-15329-4-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <5720DA00.2000005@redhat.com> Date: Wed, 27 Apr 2016 09:25:52 -0600 MIME-Version: 1.0 In-Reply-To: <1461767349-15329-4-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Rmn1BQQVMgKemFkbb6qfhSLlrktlBsCTD" Subject: Re: [Qemu-devel] [PATCH for-2.6 3/3] qom: -object error messages lost location, restore it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Rmn1BQQVMgKemFkbb6qfhSLlrktlBsCTD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/27/2016 08:29 AM, Markus Armbruster wrote: > qemu_opts_foreach() runs its callback with the error location set to > the option's location. Any errors the callback reports use the > option's location automatically. >=20 > Commit 90998d5 moved the actual error reporting from "inside" > qemu_opts_foreach() to after it. Here's a typical hunk: >=20 > if (qemu_opts_foreach(qemu_find_opts("object"), > - object_create, > - object_create_initial, NULL)) { > + user_creatable_add_opts_foreach, > + object_create_initial, &err)) { > + error_report_err(err); > exit(1); > } >=20 > Before, object_create() reports from within qemu_opts_foreach(), using > the option's location. Afterwards, we do it after > qemu_opts_foreach(), using whatever location happens to be current. > Commonly a "none" location. I agree with Dan that Error objects ought to track the Location in effect at the point the Error is first registered, rather than concatenating the two back together at the time the Error is eventually reported; but also that such a change is too big to even consider this late in 2.6. So as a band-aid, this particular patch improves the error message quality back to its useful state. Reviewed-by: Eric Blake > Note that the qemu_opts_foreach() bug just fixed could mask the bug > here: if the location it leaves dandling hasn't been clobbered, yet, s/dandling/dangling/ > it's the correct one. >=20 > Reported-by: Eric Blake > Cc: Daniel P. Berrange > Signed-off-by: Markus Armbruster > --- --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Rmn1BQQVMgKemFkbb6qfhSLlrktlBsCTD 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/ iQEcBAEBCAAGBQJXINoAAAoJEKeha0olJ0NqzH8H/3SLsVwgAgCNzLXN6gOvc1Fh Qov93KFnFkKHNzK1qdms59GxUtO7dtiy0kEOW4iyOVvejCVusjQn2oxh+iEVTiPY A/gOsTxs861bBb3Psdp3qGiqVij0V/ZnrG/nqdg4SwZ43NhyTqW00knGLkuIehtR NDa18EAi6vq5ijUpwzma4q87PBVPGQR3T394nZAdOsmfsHBliC678bGbaANjm4lR e6ZZ2PpsKUXLWbVii0Halp5QP4Jr23oD0D5Q9e/rEJOk1bkkJxwdusp4rdSqCwno mjwpSOXUSkgshQfdKpZ53kU9I58phb4K/S1FM6aqswkQfjc+RAjSiZPLBgJHa+E= =nSSo -----END PGP SIGNATURE----- --Rmn1BQQVMgKemFkbb6qfhSLlrktlBsCTD--