All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com,
	mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 24/29] qapi: Empty out qapi-schema.json
Date: Fri, 23 Feb 2018 18:50:36 +0100	[thread overview]
Message-ID: <874lm7k32r.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <a4a8b578-e5c8-b4d1-67dd-1b26983ba898@redhat.com> (Eric Blake's message of "Mon, 12 Feb 2018 16:26:23 -0600")

Eric Blake <eblake@redhat.com> writes:

> On 02/11/2018 03:36 AM, Markus Armbruster wrote:
>> The previous commit improved compile time by including less of the
>> generated QAPI headers.  This is impossible for stuff defined directly
>> in qapi-schema.json, because that ends up in headers that that pull in
>> everything.
>>
>> Move everything but include directives from qapi-schema.json to new
>> sub-module qapi/misc.json, then include just the "misc" shard where
>> possible.
>>
>> It's not possible everywhere, except:
>
> Odd wording, did you mean one of:
>
> It's possible everywhere, except:
> It's almost possible everywhere, except:

The former.

>> * monitor.c needs qmp-command.h to get qmp_init_marshall()
>
> s/marshall/marshal/

Yes.

>> * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
>>    qapi-event.h to get enum QAPIEvent
>>
>> Perhaps we'll get rid of those some other day.
>>
>> Adding a type to qapi/migration.json now recompiles some 120 instead
>> of 2300 out of 5100 objects.
>
> Getting better :)
>
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   .gitignore                         |    4 +
>>   Makefile                           |    9 +
>>   Makefile.objs                      |    4 +
>>   arch_init.c                        |    2 +-
>>   balloon.c                          |    2 +-
>>   block/iscsi.c                      |    2 +-
>>   cpus.c                             |    2 +-
>>   dump.c                             |    4 +-
>>   hmp.c                              |   10 +-
>>   hw/acpi/core.c                     |    2 +-
>>   hw/acpi/cpu.c                      |    2 +-
>>   hw/acpi/memory_hotplug.c           |    2 +-
>>   hw/acpi/vmgenid.c                  |    2 +-
>>   hw/core/qdev.c                     |    2 +-
>>   hw/i386/xen/xen-hvm.c              |    2 +-
>>   hw/ipmi/ipmi.c                     |    2 +-
>>   hw/pci/pci-stub.c                  |    2 +-
>>   hw/pci/pci.c                       |    2 +-
>>   hw/ppc/spapr_rtc.c                 |    2 +-
>>   hw/s390x/s390-skeys.c              |    2 +-
>>   hw/timer/mc146818rtc.c             |    4 +-
>>   hw/virtio/virtio-balloon.c         |    2 +-
>>   hw/watchdog/watchdog.c             |    2 +-
>>   include/hw/qdev-properties.h       |    3 +-
>>   include/monitor/monitor.h          |    2 +-
>>   include/sysemu/arch_init.h         |    2 +-
>>   include/sysemu/balloon.h           |    2 +-
>>   include/sysemu/dump.h              |    2 +-
>>   include/sysemu/hostmem.h           |    2 +-
>>   include/sysemu/replay.h            |    3 +-
>>   iothread.c                         |    2 +-
>>   migration/savevm.c                 |    3 +-
>>   numa.c                             |    4 +-
>
> Mostly mechanical,
>
>>   qapi-schema.json                   | 3098 +-----------------------------------
>>   qapi/misc.json                     | 3090 +++++++++++++++++++++++++++++++++++
>
> A huge move of content (git won't flag it as a rename, though ;(
>
> But why is the new file smaller than what was removed from the old
> file? Let's see...[1]
>
>>   qapi/run-state.json                |   10 +
>>   qdev-monitor.c                     |    2 +-
>>   qmp.c                              |    4 +-
>>   stubs/uuid.c                       |    2 +-
>>   stubs/vmgenid.c                    |    2 +-
>>   stubs/xen-hvm.c                    |    2 +-
>>   target/arm/monitor.c               |    3 +-
>>   target/i386/cpu.c                  |    4 +-
>>   tests/qmp-test.c                   |    3 +-
>>   tests/test-qobject-input-visitor.c |    2 +-
>>   tests/test-visitor-serialization.c |    1 -
>>   ui/gtk.c                           |    2 +-
>>   util/qemu-config.c                 |    2 +-
>>   vl.c                               |    4 +-
>>   49 files changed, 3181 insertions(+), 3144 deletions(-)
>>   create mode 100644 qapi/misc.json
>
> Huge email, but reviewing is not too hard.
>
>>
>> diff --git a/.gitignore b/.gitignore
>> index 42c57998fd..7f162e862f 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -38,6 +38,7 @@
>>   /qapi/qapi-commands-crypto.[ch]
>>   /qapi/qapi-commands-introspect.[ch]
>>   /qapi/qapi-commands-migration.[ch]
>> +/qapi/qapi-commands-misc.[ch]
>
> If my comments on the earlier patch result in a glob here, you
> wouldn't need these changes.
>
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -99,6 +99,7 @@ GENERATED_FILES += qapi/qapi-types-common.h qapi/qapi-types-common.c
>>   GENERATED_FILES += qapi/qapi-types-crypto.h qapi/qapi-types-crypto.c
>>   GENERATED_FILES += qapi/qapi-types-introspect.h qapi/qapi-types-introspect.c
>>   GENERATED_FILES += qapi/qapi-types-migration.h qapi/qapi-types-migration.c
>> +GENERATED_FILES += qapi/qapi-types-misc.h qapi/qapi-types-misc.c
>>   GENERATED_FILES += qapi/qapi-types-net.h qapi/qapi-types-net.c
>>   GENERATED_FILES += qapi/qapi-types-rocker.h qapi/qapi-types-rocker.c
>>   GENERATED_FILES += qapi/qapi-types-run-state.h qapi/qapi-types-run-state.c
>> @@ -116,6 +117,7 @@ GENERATED_FILES += qapi/qapi-visit-common.h qapi/qapi-visit-common.c
>>   GENERATED_FILES += qapi/qapi-visit-crypto.h qapi/qapi-visit-crypto.c
>>   GENERATED_FILES += qapi/qapi-visit-introspect.h qapi/qapi-visit-introspect.c
>>   GENERATED_FILES += qapi/qapi-visit-migration.h qapi/qapi-visit-migration.c
>> +GENERATED_FILES += qapi/qapi-visit-misc.h qapi/qapi-visit-misc.c
>
> And again, my comments about using intermediate variables and make
> text substitution would result in less duplication here.
>
>> +++ b/Makefile.objs
>> @@ -11,6 +11,7 @@ util-obj-y += qapi/qapi-types-common.o
>>   util-obj-y += qapi/qapi-types-crypto.o
>>   util-obj-y += qapi/qapi-types-introspect.o
>>   util-obj-y += qapi/qapi-types-migration.o
>> +util-obj-y += qapi/qapi-types-misc.o
>
> and possibly here too.
>
>> +++ b/hmp.c
>> @@ -23,13 +23,21 @@
>>   #include "qemu/config-file.h"
>>   #include "qemu/option.h"
>>   #include "qemu/timer.h"
>> -#include "qmp-commands.h"
>>   #include "qemu/sockets.h"
>>   #include "monitor/monitor.h"
>>   #include "monitor/qdev.h"
>>   #include "qapi/error.h"
>>   #include "qapi/opts-visitor.h"
>>   #include "qapi-builtin-visit.h"
>> +#include "qapi/qapi-commands-block.h"
>> +#include "qapi/qapi-commands-char.h"
>> +#include "qapi/qapi-commands-migration.h"
>> +#include "qapi/qapi-commands-misc.h"
>> +#include "qapi/qapi-commands-net.h"
>> +#include "qapi/qapi-commands-rocker.h"
>> +#include "qapi/qapi-commands-run-state.h"
>> +#include "qapi/qapi-commands-tpm.h"
>> +#include "qapi/qapi-commands-ui.h"
>
> Well, not every file gets a smaller list of includes ;)
>
>> +++ b/qapi-schema.json
>> @@ -92,3100 +92,4 @@
>>   { 'include': 'qapi/transaction.json' }
>>   { 'include': 'qapi/trace.json' }
>>   { 'include': 'qapi/introspect.json' }
>> -
>> -##
>> -# = Miscellanea
>> -##
>
>> -# Since: 2.11
>> -##
>> -{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
>> +{ 'include': 'qapi/misc.json' }
>
> [1] Conflict magnet. We'd better be prepared for some rebasing to get
> this patch series through.  See what the last item is here...
>
>> diff --git a/qapi/misc.json b/qapi/misc.json
>> new file mode 100644
>> index 0000000000..225631bf7d
>> --- /dev/null
>> +++ b/qapi/misc.json
>> @@ -0,0 +1,3090 @@
>> +# -*- Mode: Python -*-
>> +#
>> +
>
> Should we be thinking about copyright/license statements in the QAPI
> submodule files?  But that's a topic for another series.
>
>
>> +# Since: 2.9
>> +##
>> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
>> diff --git a/qapi/run-state.json b/qapi/run-state.json
>
> [1] ...and oops - you already hit one of those
> conflicts. watchdog-set-action disappeared in the move.  Or did it?
> [2]
>
>> index bca46a8785..a27c3c2a93 100644
>> --- a/qapi/run-state.json
>> +++ b/qapi/run-state.json
>> @@ -283,6 +283,16 @@
>>     'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
>>               'inject-nmi' ] }
>>   +
>> +##
>> +# @watchdog-set-action:
>> +#
>> +# Set watchdog action
>> +#
>> +# Since: 2.11
>> +##
>> +{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
>> +
>
> [2] Oh, you MOVED it to a different file.  Let's fix that separately,
> so that THIS patch can be just 1-1 file motion, not 1-N (making
> rebasing easier).

Okay.

>>   ##
>>   # @GUEST_PANICKED:
>>   #
>> diff --git a/qdev-monitor.c b/qdev-monitor.c
>> index 846238175f..b8f6bc3f7e 100644
>> --- a/qdev-monitor.c
>
> Looks reasonable, but not quite ready for my R-b until v3.

  reply	other threads:[~2018-02-23 17:50 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11  9:35 [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 01/29] Include qapi/qmp/qerror.h exactly where needed Markus Armbruster
2018-02-12 16:55   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 02/29] qapi: Streamline boilerplate comment generation Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 03/29] qapi: Generate up-to-date copyright notice Markus Armbruster
2018-02-12 19:40   ` Eric Blake
2018-02-16 22:53   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 04/29] qapi: Rename variable holding the QAPISchemaGenFOOVisitor Markus Armbruster
2018-02-12 16:59   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-16 22:56   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 05/29] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
2018-02-17  0:59   ` Michael Roth
2018-02-23 17:18     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 06/29] qapi: Reduce use of global variables in generators some Markus Armbruster
2018-02-17  1:22   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 07/29] qapi: Turn generators into modules Markus Armbruster
2018-02-17  1:29   ` Michael Roth
2018-02-27 15:53   ` Eric Blake
2018-02-27 16:01     ` Daniel P. Berrangé
2018-04-13 12:49       ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 08/29] qapi-gen: New common driver for code and doc generators Markus Armbruster
2018-02-12 19:42   ` Eric Blake
2018-02-23 17:20     ` Markus Armbruster
2018-02-26 20:02       ` Eric Blake
2018-02-18 22:16   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 09/29] qapi-gen: Convert from getopt to argparse Markus Armbruster
2018-02-12 19:44   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-18 22:31   ` Michael Roth
2018-02-23 17:21     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 10/29] qapi: Touch generated files only when they change Markus Armbruster
2018-02-12 19:48   ` Eric Blake
2018-02-13 15:22     ` Marc-Andre Lureau
2018-02-23 17:22       ` Markus Armbruster
2018-02-18 22:43   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 11/29] qapi: Improve include file name reporting in error messages Markus Armbruster
2018-02-18 23:11   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 12/29] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
2018-02-18 23:13   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 13/29] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
2018-02-12 19:52   ` Eric Blake
2018-02-18 23:17   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 14/29] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
2018-02-12 19:56   ` Eric Blake
2018-02-18 23:32   ` Michael Roth
2018-02-23 17:29     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 15/29] qapi: Record 'include' directives in parse tree Markus Armbruster
2018-02-12 20:03   ` Eric Blake
2018-02-18 23:57   ` Michael Roth
2018-02-23 17:31     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 16/29] qapi: Generate in source order Markus Armbruster
2018-02-12 20:06   ` Eric Blake
2018-02-19  0:01   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 17/29] qapi: Record 'include' directives in intermediate representation Markus Armbruster
2018-02-12 20:34   ` Eric Blake
2018-02-23 17:33     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 18/29] qapi: Rename generated qmp-marshal.c to qmp-commands.c Markus Armbruster
2018-02-12 20:56   ` Eric Blake
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19  0:21   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 19/29] qapi: Make code-generating visitors use QAPIGen more Markus Armbruster
2018-02-12 21:06   ` Eric Blake
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19 15:52   ` Michael Roth
2018-02-23 17:35     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 20/29] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
2018-02-12 21:44   ` Eric Blake
2018-02-23 17:36     ` Markus Armbruster
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19 19:30   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 21/29] qapi/common: Fix guardname() for funny filenames Markus Armbruster
2018-02-19 18:18   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 22/29] qapi: Generate separate .h, .c for each module Markus Armbruster
2018-02-12 22:06   ` Eric Blake
2018-02-23 17:41     ` Markus Armbruster
2018-02-26 22:39       ` Eric Blake
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 23/29] Include less of the generated modular QAPI headers Markus Armbruster
2018-02-12 22:13   ` Eric Blake
2018-02-23 17:47     ` Markus Armbruster
2018-02-13 15:54   ` Marc-Andre Lureau
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 24/29] qapi: Empty out qapi-schema.json Markus Armbruster
2018-02-12 22:26   ` Eric Blake
2018-02-23 17:50     ` Markus Armbruster [this message]
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 25/29] docs/devel/writing-qmp-commands: Update for modular QAPI Markus Armbruster
2018-02-12 22:27   ` Eric Blake
2018-02-13 16:00   ` Marc-Andre Lureau
2018-02-19 19:33   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 26/29] docs: Correct outdated information on QAPI Markus Armbruster
2018-02-12 22:29   ` Eric Blake
2018-02-13 16:03   ` Marc-Andre Lureau
2018-02-19 19:35   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files Markus Armbruster
2018-02-12 22:36   ` Eric Blake
2018-02-23 17:51     ` Markus Armbruster
2018-02-13 16:08   ` Marc-Andre Lureau
2018-02-19 19:37   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 28/29] Fix up dangling references to qmp-commands.* in comment and doc Markus Armbruster
2018-02-12 22:47   ` Eric Blake
2018-02-13 16:12   ` Marc-Andre Lureau
2018-02-19 19:38   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 29/29] qapi: Don't create useless directory qapi-generated Markus Armbruster
2018-02-12 22:48   ` Eric Blake
2018-02-13 16:15   ` Marc-Andre Lureau
2018-02-19 19:38   ` Michael Roth
2018-02-11 10:16 ` [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code no-reply
2018-02-26 22:57 ` [Qemu-devel] [PATCH v2 23.5/29] watchdog: Consolidate QAPI into single file Eric Blake
2018-02-26 23:10   ` Eric Blake
2018-02-27 14:19 ` [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code Eric Blake

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=874lm7k32r.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.