| dcdc07a9 | 20-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Make section headings start a new doc comment block
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in a free-form documentation com
qapi: Make section headings start a new doc comment block
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in a free-form documentation comment. This works for Texinfo because the generator simply prints a Texinfo section command at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there.
Make section headers start a new free-form documentation block, so the future rST document generator doesn't have to look at every line in free-form blocks and handle headings in odd places.
This change makes no difference to the generated Texinfo.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200320091805.5585-3-armbru@redhat.com>
show more ...
|
| 89bf68f9 | 24-Apr-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Generate simpler marshalling code when no arguments
When command FOO has no arguments, its generated qmp_marshal_FOO() is a bit confusing. Make it simpler:
visit_start_struct(v, NULL, N
qapi: Generate simpler marshalling code when no arguments
When command FOO has no arguments, its generated qmp_marshal_FOO() is a bit confusing. Make it simpler:
visit_start_struct(v, NULL, NULL, 0, &err); if (err) { goto out; } - - if (!err) { - visit_check_struct(v, &err); - } + visit_check_struct(v, &err); visit_end_struct(v, NULL); if (err) { goto out; }
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200424084338.26803-16-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
| 2061487b | 24-Apr-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Disallow qmp_marshal_FOO(NULL, ...)
For QMP commands without arguments, gen_marshal() laboriously generates a qmp_marshal_FOO() that copes with null @args. Turns there's just one caller that
qapi: Disallow qmp_marshal_FOO(NULL, ...)
For QMP commands without arguments, gen_marshal() laboriously generates a qmp_marshal_FOO() that copes with null @args. Turns there's just one caller that passes null instead of an empty QDict. Adjust that caller, and simplify gen_marshal().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200424084338.26803-15-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
| 7111a86e | 24-Apr-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Assert non-input visitors see only valid alternate tags
An alternate type's visit_type_FOO() fails when it runs into an invalid ->type.
This is appropriate with an input visitor: visit_start_
qapi: Assert non-input visitors see only valid alternate tags
An alternate type's visit_type_FOO() fails when it runs into an invalid ->type.
This is appropriate with an input visitor: visit_start_alternate() sets ->type according to the input, and bad input can lead to bad ->type.
It should never happen with an output, clone or dealloc visitor: if it did, the alternate being output, cloned or deallocated would be messed up beyond repair. Assert that.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200424084338.26803-12-armbru@redhat.com>
show more ...
|
| c978bd52 | 24-Apr-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Clean up visitor's recovery from input with invalid type
An alternate type's visit_type_FOO() fails when it runs into an invalid ->type. If it's an input visit, we then need to free the the o
qapi: Clean up visitor's recovery from input with invalid type
An alternate type's visit_type_FOO() fails when it runs into an invalid ->type. If it's an input visit, we then need to free the the object we got from visit_start_alternate(). We do that with qapi_free_FOO(), which uses the dealloc visitor.
Trouble is that object is in a bad state: its ->type is invalid. So the dealloc visitor will run into the same error again, and the error recovery skips deallocating the alternate's (invalid) alternative. Works, because qapi_free_FOO() ignores the error.
Avoid it instead: free the messed up object with by g_free().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200424084338.26803-11-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
| f965e8fe | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: New special feature flag "deprecated"
Unlike regular feature flags, the new special feature flag "deprecated" is recognized by the QAPI generator. For now, it's only permitted with commands,
qapi: New special feature flag "deprecated"
Unlike regular feature flags, the new special feature flag "deprecated" is recognized by the QAPI generator. For now, it's only permitted with commands, events, and struct members. It will be put to use shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200317115459.31821-26-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Doc typo fixed]
show more ...
|
| 645178c0 | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/schema: Call QAPIDoc.connect_member() in just one place
The .connect_doc() of classes that have QAPISchemaMember connect them to their documentation. Change them to delegate the actual work to
qapi/schema: Call QAPIDoc.connect_member() in just one place
The .connect_doc() of classes that have QAPISchemaMember connect them to their documentation. Change them to delegate the actual work to new QAPISchemaMember.connect_doc(). Matches the .connect_doc() that already exist.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-20-armbru@redhat.com>
show more ...
|
| 5858fd1a | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/schema: Rename QAPISchemaObjectType{Variant,Variants}
QAPISchemaObjectTypeVariants represents both object type and alternate type variants. Rename to QAPISchemaVariants.
Rename QAPISchemaObje
qapi/schema: Rename QAPISchemaObjectType{Variant,Variants}
QAPISchemaObjectTypeVariants represents both object type and alternate type variants. Rename to QAPISchemaVariants.
Rename QAPISchemaObjectTypeVariant the same way.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-19-armbru@redhat.com>
show more ...
|
| 226b5be6 | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/schema: Reorder classes so related ones are together
Move QAPISchemaAlternateType up some, so that all QAPISchemaFOOType are together. Move QAPISchemaObjectTypeVariants right behind its users.
qapi/schema: Reorder classes so related ones are together
Move QAPISchemaAlternateType up some, so that all QAPISchemaFOOType are together. Move QAPISchemaObjectTypeVariants right behind its users.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-18-armbru@redhat.com>
show more ...
|
| ed30f58d | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/schema: Change _make_features() to a take feature list
QAPISchema._make_features() takes a definition expression, and extracts its 'features' member. The other ._make_FOO() leave destructuring
qapi/schema: Change _make_features() to a take feature list
QAPISchema._make_features() takes a definition expression, and extracts its 'features' member. The other ._make_FOO() leave destructuring expressions to their callers. Change ._make_features() to match them.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200317115459.31821-17-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
| 24cfd6ad | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/introspect: Factor out _make_tree()
The value of @qmp_schema_qlit is generated from an expression tree. Tree nodes are created in several places. Factor out the common code into _make_tree().
qapi/introspect: Factor out _make_tree()
The value of @qmp_schema_qlit is generated from an expression tree. Tree nodes are created in several places. Factor out the common code into _make_tree(). This isn't much of a win now. It will pay off when we add feature flags in the next few commits.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-16-armbru@redhat.com>
show more ...
|
| 2e8a843d | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi/introspect: Rename *qlit* to reduce confusion
We generate the value of qmp_schema_qlit from an expression tree. The function doing that is named to_qlit(), and its inputs are accumulated in QA
qapi/introspect: Rename *qlit* to reduce confusion
We generate the value of qmp_schema_qlit from an expression tree. The function doing that is named to_qlit(), and its inputs are accumulated in QAPISchemaGenIntrospectVisitor._qlits. We call both its input and its output "qlit". This is confusing.
Use "tree" for input, and "qlit" only for output: rename to_qlit() to _tree_to_qlit(), ._qlits to ._trees, ._gen_qlit() to ._gen_tree().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-15-armbru@redhat.com>
show more ...
|
| 013b4efc | 17-Mar-2020 |
Markus Armbruster <armbru@redhat.com> |
qapi: Add feature flags to remaining definitions
In v4.1.0, we added feature flags just to struct types (commit 6a8c0b5102^..f3ed93d545), to satisfy an immediate need (commit c9d4070991 "file-posix:
qapi: Add feature flags to remaining definitions
In v4.1.0, we added feature flags just to struct types (commit 6a8c0b5102^..f3ed93d545), to satisfy an immediate need (commit c9d4070991 "file-posix: Add dynamic-auto-read-only QAPI feature"). In v4.2.0, we added them to commands (commit 23394b4c39 "qapi: Add feature flags to commands") to satisfy another immediate need (commit d76744e65e "qapi: Allow introspecting fix for savevm's cooperation with blockdev").
Add them to the remaining definitions: enumeration types, union types, alternate types, and events.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200317115459.31821-13-armbru@redhat.com>
show more ...
|