On 04/27/2016 12:29 AM, Markus Armbruster wrote: >>>> @@ -455,6 +460,7 @@ static void >>>> test_visitor_out_alternate(TestOutputVisitorData *data, >>>> qapi_free_UserDefAlternate(tmp); >>>> qobject_decref(arg); >>>> >>>> + qmp_output_visitor_reset(data->qov); >>>> tmp = g_new0(UserDefAlternate, 1); >>>> tmp->type = QTYPE_QDICT; >>>> tmp->u.udfu.integer = 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 test >> pass again. > > 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 be > fine. Manual visits need review: find the spots that create visitor > objects, trace the flow to their death, and convince yourself there's no > 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] -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature