qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/28] qapi: Split error.json off common.json


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 03/28] qapi: Split error.json off common.json
Date: Fri, 26 Jul 2019 16:34:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 7/26/19 7:05 AM, Markus Armbruster wrote:
>> In my "build everything" tree, changing a type in qapi/common.json
>> triggers a recompile of some 3600 out of 6600 objects (not counting
>> tests and objects that don't depend on qemu/osdep.h).
>> 
>> One common dependency is QapiErrorClass: it's used only in in
>> qapi/error.h, which uses nothing else, and is widely included.
>> 
>> Move QapiErrorClass from common.json to new error.json.  Touching
>> common.json now recompiles only some 2900 objects.
>> 
>> Cc: Eric Blake <address@hidden>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  MAINTAINERS           |  2 ++
>>  include/qapi/error.h  |  2 +-
>>  qapi/Makefile.objs    |  2 +-
>>  qapi/common.json      | 24 ------------------------
>>  qapi/error.json       | 29 +++++++++++++++++++++++++++++
>>  qapi/qapi-schema.json |  1 +
>>  6 files changed, 34 insertions(+), 26 deletions(-)
>>  create mode 100644 qapi/error.json
>
>
>> +++ b/qapi/qapi-schema.json
>> @@ -80,6 +80,7 @@
>>  # stable order, it's best to include each sub-schema just once, or
>>  # include it first right here.
>>  
>> +{ 'include': 'error.json' }
>>  { 'include': 'common.json' }
>>  { 'include': 'sockets.json' }
>>  { 'include': 'run-state.json' }
>
> Any reason why error.json is needed before common.json? But I don't see
> it as being a problem, so

The QAPI language doesn't require definition before use.  We commonly do
it anyway, because we find it easier to read.

error.json uses nothing and defines only enum QapiErrorClass, which is
implicitly used by commands that can fail.  I like to put the enum
before the first command.  Putting it before any other module is
easiest.

> Reviewed-by: Eric Blake <address@hidden>

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]