]> Git Repo - qemu.git/commit
qapi: Remove null from schema language
authorMarkus Armbruster <[email protected]>
Sat, 14 Sep 2019 15:34:56 +0000 (17:34 +0200)
committerMarkus Armbruster <[email protected]>
Tue, 24 Sep 2019 12:07:23 +0000 (14:07 +0200)
commit9d55380b5aecd4ae5324e7d4ab0a7dfc510b634d
tree7f4e84bbe481b6b933e0a193b2c6756f86a15091
parent14c32795024c815316337b019bdf88d76b429af8
qapi: Remove null from schema language

We represent the parse tree as OrderedDict.  We fetch optional dict
members with .get().  So far, so good.

We represent null literals as None.  .get() returns None both for
"absent" and for "present, value is the null literal".  Uh-oh.

Test features-if-invalid exposes this bug: "'if': null" is
misinterpreted as absent "if".

We added null to the schema language to "allow [...] an explicit
default value" (commit e53188ada5 "qapi: Allow true, false and null in
schema json", v2.4.0).  Hasn't happened; null is still unused except
as generic invalid value in tests/.

To fix, we'd have to replace .get() by something more careful, or
represent null differently.  Feasible, but we got more and bigger fish
to fry right now.  Remove the null literal from the schema language.
Replace null in tests by another invalid value.

Test features-if-invalid now behaves as it should.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20190914153506[email protected]>
Reviewed-by: Eric Blake <[email protected]>
docs/devel/qapi-code-gen.txt
scripts/qapi/common.py
tests/qapi-schema/features-if-invalid.err
tests/qapi-schema/features-if-invalid.exit
tests/qapi-schema/features-if-invalid.json
tests/qapi-schema/features-if-invalid.out
tests/qapi-schema/pragma-name-case-whitelist-crap.json
This page took 0.028511 seconds and 4 git commands to generate.