[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 03/10] qapi: Introduce a f
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 03/10] qapi: Introduce a first class 'null' type |
Date: |
Tue, 18 Jul 2017 21:43:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> Eric Blake <address@hidden> writes:
>
>> On 07/18/2017 09:53 AM, Eric Blake wrote:
>>> On 07/18/2017 08:41 AM, Markus Armbruster wrote:
>>>> I expect the 'null' type to be useful mostly for members of alternate
>>>> types.
>>>>
>>>> Signed-off-by: Markus Armbruster <address@hidden>
>>>> ---
>>>
>>
>>> Reviewed-by: Eric Blake <address@hidden>
>>
>> Actually, do we need to update any qapi docs to mention the new builtin
>> type?
>
> Yes, we do. I'll give it a shot.
Incremental patch appended. May I keep your R-by?
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index 52e3874..6d8e00c 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -283,6 +283,7 @@ The following types are predefined, and map to C as follows:
accepts size suffixes
bool bool JSON true or false
any QObject * any JSON value
+ null QNull * JSON null
QType QType JSON string matching enum QType values
@@ -536,10 +537,11 @@ can only express a choice between types represented
differently in
JSON. If a branch is typed as the 'bool' built-in, the alternate
accepts true and false; if it is typed as any of the various numeric
built-ins, it accepts a JSON number; if it is typed as a 'str'
-built-in or named enum type, it accepts a JSON string; and if it is
-typed as a complex type (struct or union), it accepts a JSON object.
-Two different complex types, for instance, aren't permitted, because
-both are represented as a JSON object.
+built-in or named enum type, it accepts a JSON string; if it is typed
+as the 'null' built-in, it accepts JSON null, and if it is typed as a
+complex type (struct or union), it accepts a JSON object. Two
+different complex types, for instance, aren't permitted, because both
+are represented as a JSON object.
The example alternate declaration above allows using both of the
following example objects:
- Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 10/10] migration: Use JSON null instead of "" to reset parameter to default, (continued)
Re: [Qemu-block] [PATCH for-2.10 10/10] migration: Use JSON null instead of "" to reset parameter to default, Dr. David Alan Gilbert, 2017/07/18
[Qemu-block] [PATCH for-2.10 03/10] qapi: Introduce a first class 'null' type, Markus Armbruster, 2017/07/18
Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 03/10] qapi: Introduce a first class 'null' type, Markus Armbruster, 2017/07/18
Re: [Qemu-block] [PATCH for-2.10 03/10] qapi: Introduce a first class 'null' type, Daniel P. Berrange, 2017/07/18
[Qemu-block] [PATCH for-2.10 06/10] hmp: Clean up and simplify hmp_migrate_set_parameter(), Markus Armbruster, 2017/07/18