[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v14 13/19] qmp: Tighten output visitor rules
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v14 13/19] qmp: Tighten output visitor rules |
Date: |
Wed, 27 Apr 2016 06:22:16 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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
- Re: [Qemu-devel] [PATCH v14 02/19] qapi-visit: Add visitor.type classification, (continued)
[Qemu-devel] [PATCH v14 12/19] spapr_drc: Expose 'null' in qom-get when there is no fdt, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 15/19] qapi-commands: Wrap argument visit in visit_start_struct, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 13/19] qmp: Tighten output visitor rules, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 16/19] qom: Wrap prop visit in visit_start_struct, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 08/19] qapi: Document visitor interfaces, add assertions, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 10/19] qapi: Add visit_type_null() visitor, Eric Blake, 2016/04/08
[Qemu-devel] [PATCH v14 18/19] qapi: Simplify semantics of visit_next_list(), Eric Blake, 2016/04/08