[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v15 02/23] qapi: Guarantee NULL obj on input vis
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v15 02/23] qapi: Guarantee NULL obj on input visitor callback error |
Date: |
Thu, 28 Apr 2016 09:41:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 04/28/2016 07:00 AM, Eric Blake wrote:
>> The commit message lists start_struct(), start_alternate(), next_list(),
>> type_str(), and type_any(). You cover them except for next_list(). Why
>> is that missing?
>
> Because *obj can be NULL after next_list() if the list is empty. But
> there may still be a weaker assertion worth having: if err, then *obj
> must be NULL; and if *obj, then err must not be set (weaker in that for
> all the other functions touched, exactly one of the two conditions can
> result, but here, !err and !*obj is valid as a third condition).
Actually, because visit_next_list() can't fail (we removed the errp
argument earlier). When we finally move the list head allocation into
visit_start_list later in the series (22/23), then we should add the
(weaker) assert there.
>
> Depending on what else you find later in the series, I may just post a
> fixup for this patch.
Still my plan.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v15 09/23] qom: Wrap prop visit in visit_start_struct, (continued)
- [Qemu-devel] [PATCH v15 09/23] qom: Wrap prop visit in visit_start_struct, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 04/23] qmp-input: Clean up stack handling, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 11/23] qmp-input: Refactor when list is advanced, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 13/23] tests: Add check-qnull, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 02/23] qapi: Guarantee NULL obj on input visitor callback error, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 02A/23] fixup! qapi: Guarantee NULL obj on input visitor callback error, Eric Blake, 2016/04/28
- [Qemu-devel] [PATCH v15 14/23] qapi: Add visit_type_null() visitor, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 05/23] qapi: Use strict QMP input visitor in more places, Eric Blake, 2016/04/27
- [Qemu-devel] [PATCH v15 08/23] monitor: Let generated code validate arguments, Eric Blake, 2016/04/27