summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-06-26 19:25:14 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-07-24 13:35:11 +0200
commit4d2d5c41a9e8ee201cda8be8701f7f9fc92e71aa (patch)
treebf7c9f1260f68a8e9d9409fd664225e324414721 /docs
parentd2f95f4d482374485234790a6fc3cca29ebb7355 (diff)
downloadqemu-4d2d5c41a9e8ee201cda8be8701f7f9fc92e71aa.tar.gz
qapi: Introduce a first class 'null' type
I expect the 'null' type to be useful mostly for members of alternate types. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/devel/qapi-code-gen.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index 52e3874efe..9903ac4c19 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -282,6 +282,7 @@ The following types are predefined, and map to C as follows:
size uint64_t like uint64_t, except StringInputVisitor
accepts size suffixes
bool bool JSON true or false
+ null QNull * JSON null
any QObject * any JSON value
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: