diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-06-13 11:58:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-06-13 11:58:00 +0100 |
commit | 4747524f9f243ca5ff1f146d37e423c00e923ee1 (patch) | |
tree | 487c935041a08eba8a83c3399ca6a9aacfc6c1fe /scripts/qapi/doc.py | |
parent | 8e23e34d989d5ce542fa26425f091fc61e1f23f4 (diff) | |
parent | 157dd363955b961ef378eb1f7817c31a7fa94d10 (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-06-12' into staging
QAPI patches for 2019-06-12
# gpg: Signature made Wed 12 Jun 2019 17:44:50 BST
# gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg: issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* remotes/armbru/tags/pull-qapi-2019-06-12:
qapi: Simplify how QAPIDoc implements its state machine
file-posix: Add dynamic-auto-read-only QAPI feature
qapi: Allow documentation for features
qapi: Disentangle QAPIDoc code
tests/qapi-schema: Error case tests for features in structs
tests/qapi-schema: Test for good feature lists in structs
qapi: Add feature flags to struct types
block/gluster: update .help of BLOCK_OPT_PREALLOC option
block/file-posix: update .help of BLOCK_OPT_PREALLOC option
qapi/block-core: update documentation of preallocation parameter
qdev: Delete unused LostTickPolicy "merge"
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi/doc.py')
-rwxr-xr-x | scripts/qapi/doc.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py index 5c8c136899..5fc0fc7e06 100755 --- a/scripts/qapi/doc.py +++ b/scripts/qapi/doc.py @@ -182,6 +182,17 @@ def texi_members(doc, what, base, variants, member_func): return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items) +def texi_features(doc): + """Format the table of features""" + items = '' + for section in doc.features.values(): + desc = texi_format(section.text) + items += '@item @code{%s}\n%s' % (section.name, desc) + if not items: + return '' + return '\n@b{Features:}\n@table @asis\n%s@end table\n' % (items) + + def texi_sections(doc, ifcond): """Format additional sections following arguments""" body = '' @@ -201,6 +212,7 @@ def texi_entity(doc, what, ifcond, base=None, variants=None, member_func=texi_member): return (texi_body(doc) + texi_members(doc, what, base, variants, member_func) + + texi_features(doc) + texi_sections(doc, ifcond)) @@ -220,7 +232,8 @@ class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor): body=texi_entity(doc, 'Values', ifcond, member_func=texi_enum_value))) - def visit_object_type(self, name, info, ifcond, base, members, variants): + def visit_object_type(self, name, info, ifcond, base, members, variants, + features): doc = self.cur_doc if base and base.is_implicit(): base = None |