qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v14 02/14] fixup! migration: New QAPI type 'MigrateAddress'


From: Markus Armbruster
Subject: Re: [PATCH v14 02/14] fixup! migration: New QAPI type 'MigrateAddress'
Date: Fri, 20 Oct 2023 14:37:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Fabiano Rosas <farosas@suse.de> writes:

> Markus Armbruster <armbru@redhat.com> writes:
>
>> Fabiano Rosas <farosas@suse.de> writes:
>>
>>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>>> ---
>>>  qapi/migration.json | 20 ++++++++++++++++++--
>>>  1 file changed, 18 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/qapi/migration.json b/qapi/migration.json
>>> index c352c7ac52..602cb706e3 100644
>>> --- a/qapi/migration.json
>>> +++ b/qapi/migration.json
>>> @@ -1519,10 +1519,25 @@
>>>  #
>>>  # @rdma: Migrate via RDMA.
>>>  #
>>> +# @file: Direct the migration stream to a file.
>>> +#
>>>  # Since 8.2
>>>  ##
>>>  { 'enum': 'MigrationAddressType',
>>> -  'data': ['socket', 'exec', 'rdma'] }
>>> +  'data': ['socket', 'exec', 'rdma', 'file'] }
>>
>> I don't like our use of spaces around parenthesis in the QAPI schema,
>> but I like inconsistency even less: please insert a space after '['.
>>
>
> Yes. But,
>
> a contributor today has to guess what is the preferred syntax. Could we
> have a checkpatch rule for this? Or should I send a patch to make the
> whole file consistent at once?
>
> Side question: are we using valid JSON at all? I threw this in a random
> online linter and it complains about the single quotes. We could have a
> proper tool doing the validation in CI.

You've come a sad, sad place.

docs/devel/qapi-code-gen.rst:

    Schema syntax
    -------------

    Syntax is loosely based on `JSON <http://www.ietf.org/rfc/rfc8259.txt>`_.
    Differences:

    * Comments: start with a hash character (``#``) that is not part of a
      string, and extend to the end of the line.

    * Strings are enclosed in ``'single quotes'``, not ``"double quotes"``.

    * Strings are restricted to printable ASCII, and escape sequences to
      just ``\\``.

    * Numbers and ``null`` are not supported.

If your reaction to item 2 is "this is stupid", you'd be exactly right.

Here's the conclusion of a discussion on possible improvements we had in
2020:
https://lore.kernel.org/qemu-devel/877dt5ofoi.fsf@dusky.pond.sub.org/




reply via email to

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