On 02/23/2018 11:20 AM, Markus Armbruster wrote:
Eric Blake <ebl...@redhat.com> writes:

On 02/11/2018 03:35 AM, Markus Armbruster wrote:
Whenever qapi-schema.json changes, we run six programs eleven times to
update eleven files.  Similar for qga/qapi-schema.json.  This is
silly.  Replace the six programs by a single program that spits out
all eleven files.

The programs become modules in new Python package qapi, along with the
helper library.  This requires moving them to scripts/qapi/.

Signed-off-by: Markus Armbruster <arm...@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---

+++ b/docs/devel/qapi-code-gen.txt

   @@ -1302,23 +1296,22 @@ Example:
       }
         const char *const example_QAPIEvent_lookup[] = {
-        [EXAMPLE_QAPI_EVENT_MY_EVENT] = "MY_EVENT",
+
+[EXAMPLE_QAPI_EVENT_MY_EVENT] = "MY_EVENT",
           [EXAMPLE_QAPI_EVENT__MAX] = NULL,
       };

Looks like our generated code indentation has slightly regressed from
what we would write by hand, but it's still okay for generated code
(and the commit message in 5/29 did call that out)

I'd prefer to have this tidied up.

Actually, we currently output with good indentation, but with different text altogether:

const QEnumLookup example_QAPIEvent_lookup = {
    .array = (const char *const[]) {
        [EXAMPLE_QAPI_EVENT_MY_EVENT] = "MY_EVENT",
    },
    .size = EXAMPLE_QAPI_EVENT__MAX
};

I'm fixing that up as part of prepping this series for PULL.


+def gen_commands(schema, output_dir, prefix):
+    blurb = ' * Schema-defined QAPI/QMP commands'

We discussed whether to make the assignment to blurb be a one-liner in
an earlier patch, but I'm also fine with the churn you have over the
course of the series.

I ran out of time, and decided to leave this one as is.

It wasn't too difficult (although the ripple effects hit 3 other patches), so I did this as well.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to