d08caefe | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: add redirection shim
qmp-shell has a new home, add a redirect for a little while as the dust settles.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.18403
scripts/qmp-shell: add redirection shim
qmp-shell has a new home, add a redirect for a little while as the dust settles.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-43-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
6be7206e | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: move to python/qemu/qmp/qmp_shell.py
The script will be unavailable for a commit or two, which will help preserve development history attached to the new file. A forwarder will be
scripts/qmp-shell: move to python/qemu/qmp/qmp_shell.py
The script will be unavailable for a commit or two, which will help preserve development history attached to the new file. A forwarder will be added shortly afterwards.
With qmp_shell in the python qemu.qmp package, now it is fully type checked, linted, etc. via the Python CI. It will be quite a bit harder to accidentally break it again in the future.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-41-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
6a1105ad | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: make QMPShellError inherit QMPError
In preparation for moving qmp-shell into the qemu.qmp package, make QMPShellError inherit from QMPError so that all custom errors in this packa
scripts/qmp-shell: make QMPShellError inherit QMPError
In preparation for moving qmp-shell into the qemu.qmp package, make QMPShellError inherit from QMPError so that all custom errors in this package all derive from QMPError.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-39-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
a64fe44d | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: remove double-underscores
They're not needed; single underscore is enough to express intent that these methods are "internal". double underscore is used as a weak name mangling, b
scripts/qmp-shell: remove double-underscores
They're not needed; single underscore is enough to express intent that these methods are "internal". double underscore is used as a weak name mangling, but that isn't beneficial for us here.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-38-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
7fc29896 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: convert usage comment to docstring
The nice usage comment should be a docstring instead of a comment, so that it's visible from other python tooling.
Signed-off-by: John Snow <js
scripts/qmp-shell: convert usage comment to docstring
The nice usage comment should be a docstring instead of a comment, so that it's visible from other python tooling.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-37-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
26d3ce9e | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: Remove too-broad-exception
We are only anticipating QMPShellErrors here, for syntax we weren't able to understand. Other errors, if any, should be allowed to percolate upwards.
S
scripts/qmp-shell: Remove too-broad-exception
We are only anticipating QMPShellErrors here, for syntax we weren't able to understand. Other errors, if any, should be allowed to percolate upwards.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-36-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
c83055ef | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: Fix empty-transaction invocation
calling "transaction( )" is pointless, but valid. Rework the parser to allow this kind of invocation. This helps clean up exception handling later
scripts/qmp-shell: Fix empty-transaction invocation
calling "transaction( )" is pointless, but valid. Rework the parser to allow this kind of invocation. This helps clean up exception handling later by removing accidental breakages of the parser that aren't explicitly forbidden.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-35-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
74688377 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: remove TODO
We still want to revamp qmp-shell again, but there's much more to the idea than the comment now intuits. Remove it.
Signed-off-by: John Snow <jsnow@redhat.com> Messag
scripts/qmp-shell: remove TODO
We still want to revamp qmp-shell again, but there's much more to the idea than the comment now intuits. Remove it.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-34-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
be19c6a7 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: use logging to show warnings
A perfect candidate is non-fatal shell history messages.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-33-jsnow@redh
scripts/qmp-shell: use logging to show warnings
A perfect candidate is non-fatal shell history messages.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-33-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
d1d14e59 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: Use context manager instead of atexit
We can invoke the shell history writing when we leave the QMPShell scope instead of relying on atexit. Doing so may be preferable to avoid gl
scripts/qmp-shell: Use context manager instead of atexit
We can invoke the shell history writing when we leave the QMPShell scope instead of relying on atexit. Doing so may be preferable to avoid global state being registered from within a class instead of from the application logic directly.
Use QMP's context manager to hook this history saving at close time, which gets invoked when we leave the context block.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-32-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
6e24a7ed | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: unprivatize 'pretty' property
Similar to verbose, there's no reason this needs to be hidden.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-30-jsn
scripts/qmp-shell: unprivatize 'pretty' property
Similar to verbose, there's no reason this needs to be hidden.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-30-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
b0b8ca17 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: Accept SocketAddrT instead of string
Don't "extend" QEMUMonitorProtocol by changing the argument types. Move the string parsing just outside of the class instead.
Signed-off-by:
scripts/qmp-shell: Accept SocketAddrT instead of string
Don't "extend" QEMUMonitorProtocol by changing the argument types. Move the string parsing just outside of the class instead.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-29-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
1eab8872 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: add mypy types
As per my usual, this patch is annotations only. Any changes with side effects are done elsewhere.
Note: pylint does not understand the subscripts for Collection i
scripts/qmp-shell: add mypy types
As per my usual, this patch is annotations only. Any changes with side effects are done elsewhere.
Note: pylint does not understand the subscripts for Collection in Python 3.6, so use the stronger Sequence type as a workaround. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-28-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
41574295 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: initialize completer early
Add an empty completer as a more type-safe placeholder instead of 'None'.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.184038
scripts/qmp-shell: initialize completer early
Add an empty completer as a more type-safe placeholder instead of 'None'.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-26-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
db12abc2 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: refactor QMPCompleter
list is a generic type, but we expect to use strings directly. We could subclass list[str], but pylint does not presently understand that invocation.
Change
scripts/qmp-shell: refactor QMPCompleter
list is a generic type, but we expect to use strings directly. We could subclass list[str], but pylint does not presently understand that invocation.
Change this class to envelop a list instead of *being* a list, for simpler mypy typing.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-25-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
6faf2384 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: Fix "FuzzyJSON" parser
I'm not sure when this regressed (Or maybe if it was ever working right to begin with?), but the Python AST requires you to change "Names" to "Constants" in
scripts/qmp-shell: Fix "FuzzyJSON" parser
I'm not sure when this regressed (Or maybe if it was ever working right to begin with?), but the Python AST requires you to change "Names" to "Constants" in order to truly convert `false` to `False`.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-24-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
ad4eebee | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: move the REPL functionality into QMPShell
Instead of doing this in main, move it into the class itself. (This makes it easier to put into the qemu.qmp package later by removing as
scripts/qmp-shell: move the REPL functionality into QMPShell
Instead of doing this in main, move it into the class itself. (This makes it easier to put into the qemu.qmp package later by removing as much as we can from the main() function.)
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-23-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
1215a1fb | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: remove prompt argument from read_exec_command
It's only ever used by one caller, we can just absorb that logic.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 2021060720
scripts/qmp-shell: remove prompt argument from read_exec_command
It's only ever used by one caller, we can just absorb that logic.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-22-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
1caa5057 | 07-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp-shell: move get_prompt() to prompt property
Small tidying; treat "prompt" like an immutable property instead of function/method/routine.
Signed-off-by: John Snow <jsnow@redhat.com> Mess
scripts/qmp-shell: move get_prompt() to prompt property
Small tidying; treat "prompt" like an immutable property instead of function/method/routine.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-21-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|