From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
Markus Armbruster <armbru@redhat.com>,
Alexander Graf <agraf@suse.de>, QEMU <qemu-devel@nongnu.org>,
"open list:sPAPR pseries" <qemu-ppc@nongnu.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH v8 18/35] qapi: Drop unused error argument for list and implicit struct
Date: Tue, 5 Jan 2016 08:58:26 -0700 [thread overview]
Message-ID: <568BE822.4060703@redhat.com> (raw)
In-Reply-To: <CAJ+F1CKAvdUmjg--pCnB7tGLs72kew=toN0cTsoBx6o=nQKN2w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]
On 01/05/2016 07:05 AM, Marc-André Lureau wrote:
> Hi
>
> On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake <eblake@redhat.com> wrote:
>> No backend was setting an error when ending the visit of a list
>> or implicit struct. Make the callers a bit easier to follow by
>> making this a part of the contract, and removing the errp
>> argument - callers can then unconditionally end an object as
>> part of cleanup without having to think about whether a second
>> error is dominated by a first, because there is no second error.
>>
>> A later patch will then tackle the larger task of splitting
>> visit_end_struct(), which can indeed set an error.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>
>
> This patch makes visit_end_list() possibly abort, while before it
> would pass the error to upper.
Not so. The only added use of &error_abort is...
> I assume that's what you are going to
> change next.
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
>> +++ b/qapi/qmp-input-visitor.c
>> @@ -153,10 +153,6 @@ static void qmp_input_start_implicit_struct(Visitor *v, void **obj,
>> }
>> }
>>
>> -static void qmp_input_end_implicit_struct(Visitor *v, Error **errp)
>> -{
>> -}
>> -
>> static void qmp_input_start_list(Visitor *v, const char *name, Error **errp)
>> {
>> QmpInputVisitor *qiv = to_qiv(v);
>> @@ -201,11 +197,11 @@ static GenericList *qmp_input_next_list(Visitor *v, GenericList **list,
>> return entry;
>> }
>>
>> -static void qmp_input_end_list(Visitor *v, Error **errp)
>> +static void qmp_input_end_list(Visitor *v)
>> {
>> QmpInputVisitor *qiv = to_qiv(v);
>>
>> - qmp_input_pop(qiv, errp);
>> + qmp_input_pop(qiv, &error_abort);
...here; but the only time that qmp_input_pop() sets error is if it is
paired with a qmp_input_push() from a struct, not a list. It is a true
programming bug if you can mismatch push(struct)/pop(list) or
push(list)/pop(struct), which deserves to abort, and which is not
triggerable in the current code base.
But you are correct that later patches then further clean up
qmp-input-visitor.c.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-01-05 15:58 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-21 17:08 [Qemu-devel] [PATCH v8 00/35] qapi visitor cleanups (post-introspection cleanups subset E) Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 01/35] qobject: Document more shortcomings in our number handling Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 02/35] qapi: Avoid use of misnamed DO_UPCAST() Eric Blake
2016-01-05 14:08 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 03/35] qapi: Drop dead dealloc visitor variable Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 04/35] hmp: Improve use of qapi visitor Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 05/35] vl: " Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 06/35] balloon: " Eric Blake
2016-01-05 14:08 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 07/35] qapi: Improve generated event " Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2016-01-05 15:21 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 08/35] qapi: Track all failures between visit_start/stop Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 09/35] qapi: Prefer type_int64 over type_int in visitors Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 10/35] qapi: Make all visitors supply uint64 callbacks Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 11/35] qapi: Consolidate visitor small integer callbacks Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 12/35] qapi: Don't cast Enum* to int* Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2016-01-05 15:23 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 13/35] qom: Use typedef for Visitor Eric Blake
2016-01-05 14:07 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 14/35] qapi: Swap visit_* arguments for consistent 'name' placement Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2016-01-05 15:32 ` Eric Blake
2016-01-05 22:47 ` Eric Blake
2016-01-06 0:01 ` [Qemu-devel] [PATCH v8 14.5/35] qapi: Update docs to match recent generator changes Eric Blake
2016-01-06 0:16 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 15/35] qom: Swap 'name' next to visitor in ObjectPropertyAccessor Eric Blake
2015-12-23 16:30 ` Eric Blake
2016-01-05 14:06 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 16/35] qapi: Swap 'name' in visit_* callbacks to match public API Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 17/35] qapi: Drop unused 'kind' for struct/enum visit Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2016-01-06 0:26 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 18/35] qapi: Drop unused error argument for list and implicit struct Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2016-01-05 15:58 ` Eric Blake [this message]
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 19/35] qmp: Fix reference-counting of qnull on empty output visit Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2016-01-06 17:42 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 20/35] qmp: Don't abuse stack to track qmp-output root Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 21/35] qapi: Document visitor interfaces, add assertions Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 22/35] qapi: Add visit_type_null() visitor Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2016-01-05 16:08 ` Eric Blake
2016-01-06 22:15 ` [Qemu-devel] [PATCH v8 22.5/35] qmp: Support explicit null on input visit Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 23/35] qmp: Tighten output visitor rules Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2016-01-06 22:18 ` Eric Blake
2016-01-06 22:40 ` [Qemu-devel] [PATCH v8 23.5/35] qmp: Tighten output visitor rules, part 2 Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 24/35] spapr_drc: Expose 'null' in qom-get when there is no fdt Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 25/35] qapi: Simplify excess input reporting in input visitors Eric Blake
2016-01-05 14:05 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 26/35] qapi: Add type.is_empty() helper Eric Blake
2016-01-05 14:04 ` Marc-André Lureau
2016-01-05 16:10 ` Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 27/35] qapi: Fix command with named empty argument type Eric Blake
2016-01-05 14:04 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 28/35] qapi: Eliminate empty visit_type_FOO_fields Eric Blake
2016-01-05 14:04 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 29/35] qapi: Canonicalize missing object to :empty Eric Blake
2015-12-23 17:54 ` [Qemu-devel] [PATCH v8 29.5/35] fixup! " Eric Blake
2016-01-05 14:03 ` [Qemu-devel] [PATCH v8 29/35] " Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 30/35] qapi-visit: Unify struct and union visit Eric Blake
2016-01-05 14:03 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 31/35] qapi: Rework deallocation of partial struct Eric Blake
2016-01-05 13:58 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 32/35] qapi: Split visit_end_struct() into pieces Eric Blake
2016-01-05 17:22 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 33/35] qapi: Simplify semantics of visit_next_list() Eric Blake
2016-01-05 17:22 ` Marc-André Lureau
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 34/35] qapi: Change visit_type_FOO() to no longer return partial objects Eric Blake
2016-01-05 17:22 ` Marc-André Lureau
2016-01-05 18:02 ` Eric Blake
2016-01-07 23:02 ` [Qemu-devel] [PATCH v8 34/35] fixup! " Eric Blake
2015-12-21 17:08 ` [Qemu-devel] [PATCH v8 35/35] RFC: qapi: Adjust layout of FooList types Eric Blake
2016-01-05 17:22 ` Marc-André Lureau
2016-01-08 16:45 ` [Qemu-devel] [PATCH] qapi: Update docs to match recent generated changes, part 2 Eric Blake
2016-01-19 9:10 ` [Qemu-devel] [PATCH v8 00/35] qapi visitor cleanups (post-introspection cleanups subset E) Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=568BE822.4060703@redhat.com \
--to=eblake@redhat.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=marcandre.lureau@gmail.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).