From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>,
Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, wenchaoqemu@gmail.com
Subject: Re: [Qemu-devel] [PATCH v3 06/14] qapi: require valid expressions
Date: Thu, 14 Aug 2014 06:26:08 -0600 [thread overview]
Message-ID: <53ECAAE0.2000105@redhat.com> (raw)
In-Reply-To: <87k36bjtrp.fsf@blackfin.pond.sub.org>
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
On 08/14/2014 03:38 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> The previous patch demonstrated that the generator could get
>> confused if an expression had conflicting meta-types, and
>> silently ignored expressions that lacked a known meta-type.
>> Fix both cases to give a sane error message.
>>
>> * scripts/qapi.py (check_exprs): Require a valid meta-type for
>> every expression.
>> * tests/qapi-schema/indented-expr.*: Use valid types.
>> * tests/qapi-schema/missing-type.*: Update expected output.
>> * tests/qapi-schema/double-type.*: Likewise.
>
> Conventional git commit message followed by GNU change log. Unusual in
> QEMU. Same elsewhere.
Habits die hard :)
>
> Explanation of the change to indented-expr.json hides in the change log
> part, where I promptly missed it :)
Okay, I'll make the subject line capitalized (which is more popular,
even if not universal) and ditch the GNU style suffix (inlining any meat
into the paragraph form) on my respin.
>> + # 'include' has already been flattened; at this point, all exprs
>> + # should have one of the remaining keys
>> + keys = (expr.has_key('enum') + expr.has_key('union') +
>> + expr.has_key('type') + expr.has_key('command') +
>> + expr.has_key('event'))
>> + if keys < 1:
>> + raise QAPIExprError(info,
>> + "Missing expression meta-type")
>> + if keys > 1:
>> + raise QAPIExprError(info,
>> + "Conflicting expression meta-types")
>> +
>> if expr.has_key('union'):
>> check_union(expr, info)
>> if expr.has_key('event'):
>
> Not the friendliest error messages, but they'll do.
I'm open to bike-shedding suggestions :) But in the absence of a
suggestion, I'll keep this part unchanged in v4.
--
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: 539 bytes --]
next prev parent reply other threads:[~2014-08-14 12:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 1:14 [Qemu-devel] [PATCH v3 00/14] drop qapi nested structs Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 01/14] qapi: consistent whitespace in tests/Makefile Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 02/14] qapi: ignore files created during make check Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 03/14] qapi: add some enum tests Eric Blake
2014-08-14 9:23 ` Markus Armbruster
2014-08-14 12:21 ` Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 04/14] qapi: better error message for bad enum Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 05/14] qapi: add some expr tests Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 06/14] qapi: require valid expressions Eric Blake
2014-08-14 9:38 ` Markus Armbruster
2014-08-14 12:26 ` Eric Blake [this message]
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 07/14] qapi: add some type check tests Eric Blake
2014-08-14 9:47 ` Markus Armbruster
2014-08-14 12:26 ` Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 08/14] qapi: add expr_name() helper Eric Blake
2014-08-14 9:49 ` Markus Armbruster
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 09/14] qapi: add check_type helper function Eric Blake
2014-08-14 10:10 ` Markus Armbruster
2014-08-14 12:42 ` Eric Blake
2014-08-14 16:10 ` Markus Armbruster
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 10/14] qapi: merge UserDefTwo and UserDefNested in tests Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 11/14] qapi: drop tests for inline subtypes Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 12/14] qapi: drop inline subtype in query-version Eric Blake
2014-08-14 11:45 ` Markus Armbruster
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 13/14] qapi: drop inline subtype in query-pci Eric Blake
2014-08-06 1:14 ` [Qemu-devel] [PATCH v3 14/14] qapi: drop support for inline subtypes Eric Blake
2014-08-12 12:47 ` [Qemu-devel] [PATCH v3 00/14] drop qapi nested structs Eric Blake
2014-08-14 12:00 ` Markus Armbruster
2014-08-15 18:12 ` Luiz Capitulino
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=53ECAAE0.2000105@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wenchaoqemu@gmail.com \
/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).