The first patch accepts decimal constants as valid schema expressions. The second patch adds the 'defaults' dictionary in command schema, see commit message and doc/ changes.
v2: Add patch 1. Address comments from Eric in patch 2: - default -> defaults - Error out for supplying default value on non-optional argument - Allow JSON integer. - Update documentation and tests. Fam Zheng (2): qapi: Allow decimal values qapi: Allow setting default values for optional parameters docs/qapi-code-gen.txt | 8 ++++++-- scripts/qapi-commands.py | 29 ++++++++++++++++++++++------- scripts/qapi.py | 23 +++++++++++++++++++++-- tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 1 + tests/test-qmp-commands.c | 7 +++++++ 6 files changed, 60 insertions(+), 11 deletions(-) -- 1.9.2