- May 01, 2021
-
-
Richard Henderson authored
Rather than force all structure members to be 'int', allow the type of the member to be specified. Reviewed-by:
Luis Pires <luis.pires@eldorado.org.br> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Luis Fernando Fujita Pires authored
Allow '64' to be specified for the instruction width command line params and use the appropriate extract and deposit functions in that case. This will be used to implement the new 64-bit Power ISA 3.1 instructions. Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Luis Pires <luis.pires@eldorado.org.br> Message-Id: <CP2PR80MB3668E123E2EFDB0ACD3A46F1DA759@CP2PR80MB3668.lamprd80.prod.outlook.com> [rth: Drop the change to the field type; use bitop_width instead of separate variables for extract/deposit; use "ull" for 64-bit constants.] Reviewed-by:
Luis Pires <luis.pires@eldorado.org.br> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Reviewed-by:
Luis Pires <luis.pires@eldorado.org.br> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Form a hex constant of the appropriate insnwidth. Begin using f-strings on changed lines. Reviewed-by:
Luis Pires <luis.pires@eldorado.org.br> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Apr 30, 2021
-
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-9-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
No functional change. Note: QAPISourceError's info parameter is Optional[] because schema.py treats the info property of its various classes as Optional to accommodate built-in types, which have no source. See prior commit 'qapi/error: assert QAPISourceInfo is not None'. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-8-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-7-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Keeping it in error.py will create some cyclic import problems when we add types to the QAPISchemaParser. Callers don't need to know the details of QAPIParseError unless they are parsing or dealing directly with the parser, so this won't create any harsh new requirements for callers in the general case. Update error.py with a little docstring that gives a nod to where the error may now be found. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-6-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Built-in stuff is not parsed from a source file, and therefore have no QAPISourceInfo. If such None info was used for reporting an error, built-in stuff would be broken. Programming error. Instead of reporting a confusing error with bogus source location then, we better crash. We currently crash only if self.col was set. Assert that self.info is not None in order to crash reliably. We can not yet change the type of the initializer to prove this cannot happen at static analysis time before the remainder of the code is fully typed. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-5-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
It's already treated as optional, with one direct caller and some subclass callers passing 'None'. Make it officially optional, which requires moving the position of the argument to come after all required parameters. QAPISemError becomes functionally identical to QAPISourceError. Keep the name to preserve its semantic meaning and avoid code churn, but remove the now-useless __init__ wrapper. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-4-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Missed in commit 2cae67bc "qapi: Use super() now we have Python 3". Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210421192233.3542904-3-jsnow@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Rename QAPIError to QAPISourceError, and then create a new QAPIError class that serves as the basis for all of our other custom exceptions, without specifying any class properties. This leaves QAPIError as a package-wide error class that's suitable for any current or future errors. (Right now, we don't have any errors that DON'T also want to specify a Source location, but this MAY change. In these cases, a common abstract ancestor would be desired.) Add docstrings to explain the intended function of each error class. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421192233.3542904-2-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-18-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
It is -- maybe -- possibly -- three nanoseconds faster. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-17-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Now with more :words:! Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-16-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Per list review: qapi-code-gen.txt reserves suffixes Kind and List only for type names, but the code rejects them for events and commands, too. It turns out we reject them earlier anyway: In check_name_upper() for event names, and in check_name_lower() for command names. Still, adjust the code for clarity over what precisely we are guarding against. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-15-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Tested-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Tested-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-14-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-13-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
This is a small rewrite to address some minor style nits. Don't compare against the empty list to check for the empty condition, and move the normalization forward to unify the check on the now-normalized structure. With the check unified, the local nested function isn't needed anymore and can be brought down into the normal flow of the function. With the nesting level changed, shuffle the error strings around a bit to get them to fit in 79 columns. Note: although ifcond is typed as Sequence[str] elsewhere, we *know* that the parser will produce real, bona-fide lists. It's okay to check isinstance(ifcond, list) here. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-12-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Annotations do not change runtime behavior. This commit *only* adds annotations. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-11-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
This is a minor adjustment that lets parameters @required and @optional take tuple arguments, in particular (). Later patches will make use of that. (Iterable would also have worked, but Iterable also includes things like generator expressions which are consumed upon iteration, which would require a rewrite to make sure that each input was only traversed once. Collection implies the "can re-iterate" property.) Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-10-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Casts are instructions to the type checker only, they aren't "safe" and should probably be avoided in general. In this case, when we perform type checking on a nested structure, the type of each field does not "stick". (See PEP 647 for an example of "type narrowing" that does "stick". It is available in Python 3.10, so we can't use it yet.) We don't need to assert that something is a str if we've already checked or asserted that it is -- use a cast instead for these cases. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-9-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
Prior to this commit, specifying a non-object value here causes the QAPI parser to crash in expr.py with a stack trace with (likely) an AttributeError when we attempt to call that value's items() method. This member needs to be an object (Dict), and not anything else. Add a check for this with a nicer error message, and formalize that check with new test cases that exercise that error. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-8-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
For readability purposes only, shimmy the early return upwards to the top of the function, so cases proceed in order from least to most complex. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-7-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
mypy isn't fond of allowing you to check for bool membership in a collection of str elements. Guard this lookup for precisely when we were given a name. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-6-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
mypy does not know the types of values stored in Dicts that masquerade as objects. Help the type checker out by constraining the type. Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-5-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
OrderedDict is a subtype of dict, so we can check for a more general form. These functions do not themselves depend on it being any particular type. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-4-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
The function can just use the argument from the scope above. Otherwise, we get shadowed argument errors because the parameter name clashes with the name of a variable already in-scope. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-3-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
John Snow authored
The linter yaps after 0825f62c. Fix this trivial issue to restore the linter baseline. (Yes, ideally -- and soon -- the linter will be part of CI so we don't clutter up the log with fixups. For now, though, the baseline is useful for testing intermediate commits as types are added to the QAPI library.) Signed-off-by:
John Snow <jsnow@redhat.com> Message-Id: <20210421182032.3521476-2-jsnow@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Apr 01, 2021
-
-
Thomas Huth authored
Recent QEMU versions now sometimes exit cleanly with an error message that a bus is not available for a specified device. Don't flag those as an error in the device-crash-test script. Message-Id: <20210323164718.1393792-1-thuth@redhat.com> Acked-by:
John Snow <jsnow@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Mar 24, 2021
-
-
Alex Bennée authored
Some packaged versions of Sphinx (fedora33/alpine so far) have issues with the annotated C code that kernel-doc spits out. Without knowing about things like QEMU_PLUGIN_EXPORT it chokes trying to understand the code. Evidently this is a problem for the kernel as well as the long stream of regex substitutions we add to in this patch can attest. Fortunately we have a fairly common format for all our compiler shenanigans as applied to functions so lets just filter them all out. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210323165308.15244-2-alex.bennee@linaro.org>
-
- Mar 23, 2021
-
-
Markus Armbruster authored
Union branch names should use '-', not '_'. Enforce this. The only offenders are in tests/. Fix them. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-29-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> [Commit message typo fixed]
-
Markus Armbruster authored
Enum members should use '-', not '_'. Enforce this. Fix the fixable offenders (all in tests/), and add the remainder to pragma member-name-exceptions. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-28-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Struct members, including command arguments, event data, and union inline base members, should use '-', not '_'. Enforce this. Fix the fixable offenders (all in tests/), and add the remainder to pragma member-name-exceptions. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-27-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Command names should be lower-case. Enforce this. Fix the fixable offenders (all in tests/), and add the remainder to pragma command-name-exceptions. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-25-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Feature names should use '-', not '_'. Enforce this. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-24-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Command names and member names within a type should be all lower case with words separated by a hyphen. We also accept underscore. Rework check_name_lower() to optionally reject underscores, but don't use that option, yet. Update expected test output for the changed error message. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-23-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Rename pragma returns-whitelist to command-returns-exceptions, and name-case-whitelist to member-name-case-exceptions. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-20-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-17-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
Type names should be CamelCase. Enforce this. The only offenders are in tests/. Fix them. Add test type-case to cover the new error. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-15-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> [Regexp simplified, new test made more robust]
-