Revision tags: v9.2.0, v9.1.2, v9.1.1, v9.1.0 |
|
#
604dc989 |
| 06-May-2024 |
Richard Henderson <richard.henderson@linaro.org> |
Merge tag 'pull-qapi-2024-05-06' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2024-05-06
# -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFA
Merge tag 'pull-qapi-2024-05-06' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2024-05-06
# -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmY4uIASHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTCYoQAK8Y2SSPlRqwdyYWqQHcPuQe4ThvnT2l # y1Dzcy0MGKdeDQng+lyMh9x50U6vMd33TaWEDZ4PEprSLirWnRIIL9/qgrc+obYB # LfncQR7BRLEPYRA0cQwvSBNzSLgCiySoa9x98yCB1ZZGQsAMz4p1j8qDpJFAL2qa # VThXFcBaUOPRKFDwp03r8n8PFsaqaBVjI/2YX13EyJksaPNLNT6Z2xfcgREXFu2I # gWfFR21kJwkUAgkfc6LhmqlpKXBpKQ+bWCmV1G/+LZosid3B8jfKOfOx4s9q9g5G # N7HVRSHlqPyGQeJGaiiKgPZyoRh65L0YRa3OtYoJL9ngx1P7opAGxnxSsARduNg3 # yQbbFY4c99HuxgxfMLwRPWr6Xm3c5DEvdIwoVRWm1ajJynbLWNiTN/uQs+tIEFbr # 4usxqAQRo2G5WkY9JGuDuBJkZTp1/6pEM0xVrRgGYH9jr8LZrS2HPrnbcsa3eqAl # UqSfu8HAL8j1wiBAr83DQe+SuoyRfrnFaTNYAILFG4RUsWF2u44RvkceGroyq3s1 # mgHFZGF0+m8K7TXqeJvkSgg4wr2AnavXrb79Zz2JVut0X6K6S4AbueTBIn8zT2EX # uGHhm4ZW5JUq6Wz6bQtq6/IUa/k2pAlszVFHe3Yn50J3CUU5dR/nYry7Cx4Q6/KT # h4vzopMBjVv1 # =3Pxa # -----END PGP SIGNATURE----- # gpg: Signature made Mon 06 May 2024 04:01:20 AM PDT # 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]
* tag 'pull-qapi-2024-05-06' of https://repo.or.cz/qemu/armbru: qapi: Simplify QAPISchemaVariants @tag_member qapi: Move conditional code from QAPISchemaVariants to its subtypes qapi: Rename QAPISchemaAlternateType.variants to .alternatives qapi: Rename QAPISchemaObjectType.variants to .branches qapi: Rename visitor parameter @variants to @alternatives qapi: Rename visitor parameter @variants to @branches qapi: New QAPISchemaBranches, QAPISchemaAlternatives
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
#
3ff2a5a3 |
| 15-Mar-2024 |
Markus Armbruster <armbru@redhat.com> |
qapi: Rename QAPISchemaObjectType.variants to .branches
A previous commit narrowed the type of QAPISchemaObjectType.variants from QAPISchemaVariants to QAPISchemaBranches. Rename it to .branches.
qapi: Rename QAPISchemaObjectType.variants to .branches
A previous commit narrowed the type of QAPISchemaObjectType.variants from QAPISchemaVariants to QAPISchemaBranches. Rename it to .branches.
Same for .__init__() parameter @variants.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
Revision tags: v8.0.0 |
|
#
ae2b8734 |
| 14-Dec-2022 |
Peter Maydell <peter.maydell@linaro.org> |
Merge tag 'pull-qapi-2022-12-14-v2' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2022-12-14
# gpg: Signature made Wed 14 Dec 2022 19:14:34 GMT # gpg: using
Merge tag 'pull-qapi-2022-12-14-v2' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2022-12-14
# gpg: Signature made Wed 14 Dec 2022 19:14:34 GMT # 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
* tag 'pull-qapi-2022-12-14-v2' of https://repo.or.cz/qemu/armbru: (30 commits) qapi: Drop temporary logic to support conversion step by step qapi qga: Elide redundant has_FOO in generated C qapi virtio: Elide redundant has_FOO in generated C qapi ui: Elide redundant has_FOO in generated C qapi transaction: Elide redundant has_FOO in generated C qapi tpm: Elide redundant has_FOO in generated C qapi stats: Elide redundant has_FOO in generated C qapi run-state: Elide redundant has_FOO in generated C qapi rocker: Elide redundant has_FOO in generated C qapi replay: Elide redundant has_FOO in generated C qapi qdev qom: Elide redundant has_FOO in generated C qapi pci: Elide redundant has_FOO in generated C qapi net: Elide redundant has_FOO in generated C qapi misc: Elide redundant has_FOO in generated C qapi migration: Elide redundant has_FOO in generated C qapi machine: Elide redundant has_FOO in generated C qapi job: Elide redundant has_FOO in generated C qapi dump: Elide redundant has_FOO in generated C qapi crypto: Elide redundant has_FOO in generated C qapi chardev: Elide redundant has_FOO in generated C ...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
Revision tags: v7.2.0 |
|
#
44ea9d9b |
| 04-Nov-2022 |
Markus Armbruster <armbru@redhat.com> |
qapi: Start to elide redundant has_FOO in generated C
In QAPI, absent optional members are distinct from any present value. We thus represent an optional schema member FOO as two C members: a FOO wi
qapi: Start to elide redundant has_FOO in generated C
In QAPI, absent optional members are distinct from any present value. We thus represent an optional schema member FOO as two C members: a FOO with the member's type, and a bool has_FOO. Likewise for function arguments.
However, has_FOO is actually redundant for a pointer-valued FOO, which can be null only when has_FOO is false, i.e. has_FOO == !!FOO. Except for arrays, where we a null FOO can also be a present empty array.
The redundant has_FOO are a nuisance to work with. Improve the generator to elide them. Uses of has_FOO need to be replaced as follows.
Tests of has_FOO become the equivalent comparison of FOO with null. For brevity, this is commonly done by implicit conversion to bool.
Assignments to has_FOO get dropped.
Likewise for arguments to has_FOO parameters.
Beware: code may violate the invariant has_FOO == !!FOO before the transformation, and get away with it. The above transformation can then break things. Two cases:
* Absent: if code ignores FOO entirely when !has_FOO (except for freeing it if necessary), even non-null / uninitialized FOO works. Such code is known to exist.
* Present: if code ignores FOO entirely when has_FOO, even null FOO works. Such code should not exist.
In both cases, replacing tests of has_FOO by FOO reverts their sense. We have to fix the value of FOO then.
To facilitate review of the necessary updates to handwritten code, add means to opt out of this change, and opt out for all QAPI schema modules where the change requires updates to handwritten code. The next few commits will remove these opt-outs in reviewable chunks, then drop the means to opt out.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221104160712.3005652-5-armbru@redhat.com>
show more ...
|
#
7df18461 |
| 04-Nov-2022 |
Markus Armbruster <armbru@redhat.com> |
qapi: Tidy up whitespace in generated code
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221104160712.3005652-3-armbru@red
qapi: Tidy up whitespace in generated code
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221104160712.3005652-3-armbru@redhat.com>
show more ...
|
Revision tags: v7.0.0, v6.2.0 |
|
#
dd61b91c |
| 29-Oct-2021 |
Richard Henderson <richard.henderson@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-10-29' into staging
QAPI patches patches for 2021-10-29
# gpg: Signature made Fri 29 Oct 2021 12:28:53 PM PDT # gpg:
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-10-29' into staging
QAPI patches patches for 2021-10-29
# gpg: Signature made Fri 29 Oct 2021 12:28:53 PM PDT # 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]
* remotes/armbru/tags/pull-qapi-2021-10-29: qapi: Extend -compat to set policy for unstable interfaces qapi: Factor out compat_policy_input_ok() qapi: Generalize enum member policy checking qapi: Generalize command policy checking qapi: Generalize struct member policy checking qapi: Tools for sets of special feature flags in generated code qapi: Eliminate QCO_NO_OPTIONS for a slight simplification qapi: Mark unstable QMP parts with feature 'unstable' qapi: New special feature flag "unstable"
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
#
57df0dff |
| 28-Oct-2021 |
Markus Armbruster <armbru@redhat.com> |
qapi: Extend -compat to set policy for unstable interfaces
New option parameters unstable-input and unstable-output set policy for unstable interfaces just like deprecated-input and deprecated-outpu
qapi: Extend -compat to set policy for unstable interfaces
New option parameters unstable-input and unstable-output set policy for unstable interfaces just like deprecated-input and deprecated-output set policy for deprecated interfaces (see commit 6dd75472d5 "qemu-options: New -compat to set policy for deprecated interfaces"). This is intended for testing users of the management interfaces. It is experimental.
For now, this covers only syntactic aspects of QMP, i.e. stuff tagged with feature 'unstable'. We may want to extend it to cover semantic aspects, or the command line.
Note that there is no good way for management application to detect presence of these new option parameters: they are not visible output of query-qmp-schema or query-command-line-options. Tolerable, because it's meant for testing. If running with -compat fails, skip the test.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20211028102520.747396-10-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Doc comments fixed up]
show more ...
|
#
c83fcfaf |
| 26-Aug-2021 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-08-26' into staging
QAPI patches patches for 2021-08-26
# gpg: Signature made Thu 26 Aug 2021 13:18:34 BST # gpg: usi
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-08-26' into staging
QAPI patches patches for 2021-08-26
# gpg: Signature made Thu 26 Aug 2021 13:18:34 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-2021-08-26: qapi: make 'if' condition strings simple identifiers qapi: add 'not' condition operation qapi: Use 'if': { 'any': ... } where appropriate qapi: add 'any' condition qapi: replace if condition list with dict {'all': [...]} qapidoc: introduce QAPISchemaIfCond.docgen() qapi: introduce QAPISchemaIfCond.cgen() qapi: add QAPISchemaIfCond.is_present() qapi: wrap Sequence[str] in an object docs: update the documentation upfront about schema configuration qapi: Fix crash on redefinition with a different condition
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
Revision tags: v6.1.0 |
|
#
f17539c8 |
| 04-Aug-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qapi: wrap Sequence[str] in an object
Mechanical change, except for a new assertion in QAPISchemaEntity.ifcond().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <2021080
qapi: wrap Sequence[str] in an object
Mechanical change, except for a new assertion in QAPISchemaEntity.ifcond().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210804083105.97531-3-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Rebased with obvious conflicts, commit message adjusted] Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
2e1293cb |
| 19-Mar-2021 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-03-16-v4' into staging
QAPI patches patches for 2021-03-16
# gpg: Signature made Fri 19 Mar 2021 15:06:52 GMT # gpg:
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-03-16-v4' into staging
QAPI patches patches for 2021-03-16
# gpg: Signature made Fri 19 Mar 2021 15:06:52 GMT # 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-2021-03-16-v4: qapi: New -compat deprecated-input=crash qapi: Implement deprecated-input=reject for QMP command arguments qapi: Implement deprecated-input=reject for QMP commands test-util-sockets: Add stub for monitor_set_cur() qapi: Implement deprecated-output=hide for QMP introspection monitor: Drop query-qmp-schema 'gen': false hack qapi: Implement deprecated-output=hide for QMP event data qapi: Implement deprecated-output=hide for QMP events qapi: Implement deprecated-output=hide for QMP command results qemu-options: New -compat to set policy for deprecated interfaces qemuutil: remove qemu_set_fd_handler duplicate symbol
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
a291a38f |
| 18-Mar-2021 |
Markus Armbruster <armbru@redhat.com> |
qapi: Implement deprecated-output=hide for QMP event data
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP event data: suppress deprecat
qapi: Implement deprecated-output=hide for QMP event data
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP event data: suppress deprecated members.
No QMP event data is deprecated right now.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-6-armbru@redhat.com>
show more ...
|
#
278fc2f7 |
| 18-Mar-2021 |
Markus Armbruster <armbru@redhat.com> |
qapi: Implement deprecated-output=hide for QMP events
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP events: suppress deprecated ones.
qapi: Implement deprecated-output=hide for QMP events
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP events: suppress deprecated ones.
No QMP event is deprecated right now.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-5-armbru@redhat.com>
show more ...
|
#
e90ef023 |
| 19-Feb-2021 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-02-18' into staging
QAPI patches patches for 2021-02-18
# gpg: Signature made Thu 18 Feb 2021 18:51:35 GMT # gpg: usi
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-02-18' into staging
QAPI patches patches for 2021-02-18
# gpg: Signature made Thu 18 Feb 2021 18:51:35 GMT # 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-2021-02-18: qapi/introspect.py: set _gen_tree's default ifcond argument to () qapi/introspect.py: Type _gen_tree variants as Sequence[str] qapi/introspect.py: Update copyright and authors list qapi/introspect.py: Add docstrings to _gen_tree and _tree_to_qlit qapi/introspect.py: add type hint annotations qapi/introspect.py: remove _gen_variants helper qapi/introspect.py: improve readability of _tree_to_qlit qapi/introspect.py: improve _tree_to_qlit error message qapi/introspect.py: create a typed 'Annotated' data strutcure qapi/introspect.py: Introduce preliminary tree typing qapi/introspect.py: Always define all 'extra' dict keys qapi/introspect.py: replace 'extra' dict with 'comment' argument qapi/introspect.py: Unify return type of _make_tree() qapi/introspect.py: guard against ifcond/comment misuse qapi/introspect.py: add _gen_features helper qapi/introspect.py: use _make_tree for features nodes qapi/introspect.py: assert schema is not None qapi: Replace List[str] with Sequence[str] for ifcond
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
2184bca7 |
| 15-Feb-2021 |
John Snow <jsnow@redhat.com> |
qapi: Replace List[str] with Sequence[str] for ifcond
It does happen to be a list (as of now), but we can describe it in more general terms with no loss in accuracy to allow tuples and other constru
qapi: Replace List[str] with Sequence[str] for ifcond
It does happen to be a list (as of now), but we can describe it in more general terms with no loss in accuracy to allow tuples and other constructs.
In the future, we can write "ifcond: Sequence[str] = ()" as a default parameter, which we could not do safely with a Mutable type like a List.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210216021809.134886-2-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
4f799257 |
| 08-Feb-2021 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-02-08' into staging
QAPI patches patches for 2021-02-08
# gpg: Signature made Mon 08 Feb 2021 13:54:26 GMT # gpg: usi
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-02-08' into staging
QAPI patches patches for 2021-02-08
# gpg: Signature made Mon 08 Feb 2021 13:54:26 GMT # 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-2021-02-08: qapi: enable strict-optional checks qapi: type 'info' as Optional[QAPISourceInfo] qapi/gen: Drop support for QAPIGen without a file name qapi/commands: Simplify command registry generation qapi/gen: Support switching to another module temporarily qapi/gen: write _genc/_genh access shims qapi: centralize the built-in module name definition qapi/gen: Combine ._add_[user|system]_module qapi: use './builtin' as the built-in module name qapi: use explicitly internal module names qapi/gen: Replace ._begin_system_module() qapi: centralize is_[user|system|builtin]_module methods qapi/gen: inline _wrap_ifcond into end_if() qapi/main: handle theoretical None-return from re.match() qapi/events: fix visit_event typing qapi/commands: assert arg_type is not None
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
4a82e468 |
| 01-Feb-2021 |
John Snow <jsnow@redhat.com> |
qapi: type 'info' as Optional[QAPISourceInfo]
For everything typed so far, type this parameter as Optional[QAPISourceInfo].
In the most generic case, QAPISchemaEntity's info field may be None to re
qapi: type 'info' as Optional[QAPISourceInfo]
For everything typed so far, type this parameter as Optional[QAPISourceInfo].
In the most generic case, QAPISchemaEntity's info field may be None to represent types that come from built-in definitions. Although some Entity types may not currently have any built-in definitions, it is not easily possible to constrain the type except on an ad-hoc basis using assertions.
It's easier and simpler, then, to just say it's always an Optional type.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-16-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
4ab0ff6d |
| 01-Feb-2021 |
Markus Armbruster <armbru@redhat.com> |
qapi/gen: Combine ._add_[user|system]_module
With callers to _add_system_module now explicitly using the './' prefix to indicate a system module, there is no longer any reason to have separate inter
qapi/gen: Combine ._add_[user|system]_module
With callers to _add_system_module now explicitly using the './' prefix to indicate a system module, there is no longer any reason to have separate interfaces for adding system vs user modules; use a unified interface that differentiates based on the name.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-10-jsnow@redhat.com>
show more ...
|
#
12893a8e |
| 01-Feb-2021 |
John Snow <jsnow@redhat.com> |
qapi: use explicitly internal module names
QAPISchemaModularCVisitor._add_system_module() prefixes './' to its name argument to make it a module name. Pass the module name instead. This will allow
qapi: use explicitly internal module names
QAPISchemaModularCVisitor._add_system_module() prefixes './' to its name argument to make it a module name. Pass the module name instead. This will allow us to coalesce the methods to add modules later on.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-8-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message reworded] Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
3cc01c54 |
| 01-Feb-2021 |
John Snow <jsnow@redhat.com> |
qapi/events: fix visit_event typing
Actually, the arg_type can indeed be Optional.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-3-jsnow@redhat.com> Reviewed-by: M
qapi/events: fix visit_event typing
Actually, the arg_type can indeed be Optional.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-3-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
Revision tags: v5.2.0 |
|
#
2387df49 |
| 12-Oct-2020 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-10-10' into staging
QAPI patches patches for 2020-10-10
# gpg: Signature made Sat 10 Oct 2020 10:43:14 BST # gpg: usi
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-10-10' into staging
QAPI patches patches for 2020-10-10
# gpg: Signature made Sat 10 Oct 2020 10:43:14 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-2020-10-10: (34 commits) qapi/visit.py: add type hint annotations qapi/visit.py: remove unused parameters from gen_visit_object qapi/visit.py: assert tag_member contains a QAPISchemaEnumType qapi/types.py: remove one-letter variables qapi/types.py: add type hint annotations qapi/gen.py: delint with pylint qapi/gen.py: update write() to be more idiomatic qapi/gen.py: Remove unused parameter qapi/gen.py: add type hint annotations qapi/gen: Make _is_user_module() return bool qapi/source.py: delint with pylint qapi/source.py: add type hint annotations qapi/commands.py: add type hint annotations qapi/commands.py: Don't re-bind to variable of different type qapi/events.py: Move comments into docstrings qapi/events.py: add type hint annotations qapi: establish mypy type-checking baseline qapi/common.py: move build_params into gen.py qapi/common.py: Convert comments into docstrings, and elaborate qapi/common.py: add type hint annotations ...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
1a503761 |
| 09-Oct-2020 |
John Snow <jsnow@redhat.com> |
qapi/events.py: Move comments into docstrings
Clarify them while we're here.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa
qapi/events.py: Move comments into docstrings
Clarify them while we're here.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-21-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
d1b21b39 |
| 09-Oct-2020 |
John Snow <jsnow@redhat.com> |
qapi/events.py: add type hint annotations
Annotations do not change runtime behavior. This commit *only* adds annotations.
Note: __init__ does not need its return type annotated, as it is special.
qapi/events.py: add type hint annotations
Annotations do not change runtime behavior. This commit *only* adds annotations.
Note: __init__ does not need its return type annotated, as it is special. https://mypy.readthedocs.io/en/stable/class_basics.html#annotating-init-methods
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-20-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
e6a34cd7 |
| 09-Oct-2020 |
John Snow <jsnow@redhat.com> |
qapi/common.py: move build_params into gen.py
Including it in common.py creates a circular import dependency; schema relies on common, but common.build_params requires a type annotation from schema.
qapi/common.py: move build_params into gen.py
Including it in common.py creates a circular import dependency; schema relies on common, but common.build_params requires a type annotation from schema. To type this properly, it needs to be moved outside the cycle.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-18-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
5af8263d |
| 09-Oct-2020 |
John Snow <jsnow@redhat.com> |
qapi: Remove wildcard includes
Wildcard includes become hard to manage when refactoring and dealing with circular dependencies with strictly typed mypy.
flake8 also flags each one as a warning, as
qapi: Remove wildcard includes
Wildcard includes become hard to manage when refactoring and dealing with circular dependencies with strictly typed mypy.
flake8 also flags each one as a warning, as it is not smart enough to know which names exist in the imported file.
Remove them and include things explicitly by name instead.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201009161558.107041-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
7137a960 |
| 09-Oct-2020 |
John Snow <jsnow@redhat.com> |
qapi: Prefer explicit relative imports
All of the QAPI include statements are changed to be package-aware, as explicit relative imports.
A quirk of Python packages is that the name of the package e
qapi: Prefer explicit relative imports
All of the QAPI include statements are changed to be package-aware, as explicit relative imports.
A quirk of Python packages is that the name of the package exists only *outside* of the package. This means that to a module inside of the qapi folder, there is inherently no such thing as the "qapi" package. The reason these imports work is because the "qapi" package exists in the context of the caller -- the execution shim, where sys.path includes a directory that has a 'qapi' folder in it.
When we write "from qapi import sibling", we are NOT referencing the folder 'qapi', but rather "any package named qapi in sys.path". If you should so happen to have a 'qapi' package in your path, it will use *that* package.
When we write "from .sibling import foo", we always reference explicitly our sibling module; guaranteeing consistency in *where* we are importing these modules from.
This can be useful when working with virtual environments and packages in development mode. In development mode, a package is installed as a series of symlinks that forwards to your same source files. The problem arises because code quality checkers will follow "import qapi.x" to the "installed" version instead of the sibling file and -- even though they are the same file -- they have different module paths, and this causes cyclic import problems, false positive type mismatch errors, and more.
It can also be useful when dealing with hierarchical packages, e.g. if we allow qemu.core.qmp, qemu.qapi.parser, etc.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201009161558.107041-6-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|