From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avOU1-0006wa-DW for qemu-devel@nongnu.org; Wed, 27 Apr 2016 08:22:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avOTy-0000jP-8B for qemu-devel@nongnu.org; Wed, 27 Apr 2016 08:22:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avOTy-0000jJ-2r for qemu-devel@nongnu.org; Wed, 27 Apr 2016 08:22:18 -0400 References: <1460131992-32278-1-git-send-email-eblake@redhat.com> <1460131992-32278-14-git-send-email-eblake@redhat.com> <877ffzutw8.fsf@dusky.pond.sub.org> <57201615.4040801@redhat.com> <87zisfr2cm.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <5720AEF8.1060806@redhat.com> Date: Wed, 27 Apr 2016 06:22:16 -0600 MIME-Version: 1.0 In-Reply-To: <87zisfr2cm.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QSaH1gugijXPjMk02jubAq51Q88A0Mdkg" Subject: Re: [Qemu-devel] [PATCH v14 13/19] qmp: Tighten output visitor rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QSaH1gugijXPjMk02jubAq51Q88A0Mdkg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/27/2016 12:29 AM, Markus Armbruster wrote: >>>> @@ -455,6 +460,7 @@ static void test_visitor_out_alternate(TestOutpu= tVisitorData *data, >>>> qapi_free_UserDefAlternate(tmp); >>>> qobject_decref(arg); >>>> >>>> + qmp_output_visitor_reset(data->qov); >>>> tmp =3D g_new0(UserDefAlternate, 1); >>>> tmp->type =3D QTYPE_QDICT; >>>> tmp->u.udfu.integer =3D 1; >>> >>> How did you find the places that now need qmp_output_visitor_reset()?= >> >> Ran the test, found what asserted, and added a reset() to make the tes= t >> pass again. >=20 > Should've gotten them all in tests, because tests have trivial control > flow. There's a risk of missing resets in QEMU proper. I figure it's > small. Generated visits shouldn't reuse visitor objects, thus should b= e > fine. Manual visits need review: find the spots that create visitor > objects, trace the flow to their death, and convince yourself there's n= o > reuse. Okay, I've done an audit, and will update the commit message accordingly - outside of generated code and testsuites, there were only 5 uses of qmp_output_visitor_new(), all of which were used on a single visit before destruction. So to date only the testsuite was reusing things. [2 of those uses will be dropped in a later series of mine, when I add a QAPI clone visitor] --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --QSaH1gugijXPjMk02jubAq51Q88A0Mdkg 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/ iQEcBAEBCAAGBQJXIK74AAoJEKeha0olJ0NqRQgIAKp5WxuahnVbCgBpy92VQaLv pSBPdz9K8Qd4xHnRtEHHhNYovxbaltw3kcz5SwaG/vz6MEslvgAvg6B3v0QVEZM6 nnwkKIrXkYlVmmuGjl5QJAP2ywmf1Ct+3UIxECj/Xpj93Z+v3fcTdgRdFehNfkEo qCtp/OvQXPO4BF/ZJqgrqCvx2itp7cuJEqIRmI6kdmBrSn3GC0+gpO95q4WfUOe6 kUmqgKmlmfRr/WyuXsLZ6YR8GlnSOGhbS7VK3J3FoRSVlxSNMyQhqFpD+6QwpkP0 US9fT8GDx+tqcPfCKVfmdygO6gYe0WfH+ugGK1Z1wfFcOmNj2ngoRqHbxHKlFBs= =XlFm -----END PGP SIGNATURE----- --QSaH1gugijXPjMk02jubAq51Q88A0Mdkg--