qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]