- Jun 18, 2021
-
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
This is meant to represent any generic object seen in a QMPMessage, not just the root object itself. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-27-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
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>
-
John Snow authored
No real reason to hide this behind an underscore; make it part of the initializer and make it a regular RW attribute. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-20-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
It's less useful, but it makes the initialization methods LSP consistent, which quiets a mypy complaint. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-19-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Use argparse instead of an open-coded CLI parser, for consistency with everything else. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-18-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
A bit more idiomatic, and quiets some linter warnings. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-17-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Shushes pylint. I don't always mind these patterns personally, but I'm not as sure that I want to remove the warning from pylint's repertoire entirely. Oh well. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-16-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
We want to remove exceptions that are too broad here; we only want to catch IOErrors that get raised as a direct result of the open call. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-15-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
A bit of churn and housekeeping for pylint, flake8 et al. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-14-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
This function returns None when it doesn't find a match; do that explicitly. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-13-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Not something I control, sorry, pylint. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-12-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
(2014 me had never written python before.) Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-11-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Linters get angry when we don't define state at init time. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-10-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-9-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Methods with no self-use should belong to the class. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-8-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Don't use 'qmp' here, which shadows the qmp module. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-7-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
It needs to match the parent's signature -- the negotiate parameter must be optional. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-6-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Fixes: 50d189c9 Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-5-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
The signatures need to match. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-4-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
A lot of fiddling around to get us below 80 columns. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-3-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-2-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Add a little forwarder shim until we are sure that everyone is comfortable with how to use the tools in their new packaged location. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-12-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Remove the shebang, and add a package-defined entry point instead. Now, it can be accessed using 'qemu-ga-client' from the command line after installing the package. The next commit adds a forwarder shim that allows the running of this script without needing to install the package again. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-11-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
The script itself will be unavailable for a few commits before being restored, with no way to run it right after this commit. This helps move git history into the new file. To prevent linter regressions, though, we do need to immediately touch up the filename to remove dashes (to make the module importable), and remove the executable bit. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-10-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
This script is in slightly rough shape, but it still works. A lot of care went into its initial development. In good faith, I'm updating it to the latest Python coding standards. If there is in interest in this script, though, I'll be asking for a contributor to take care of it further. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-9-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
It's only a Dict[str, Any] most of the time. It's not actually guaranteed to be anything in particular. Fix this type to be more accurate to the reality we live in. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-8-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
I'm only doing a very quick best-effort to preserve this script, to help keep it from breaking further. I think there are pending ideas swirling on the right way to implement better SDKs and better clients, and this script might be a handy reference for those discussions. It presents some interesting design problems, like static type safety when using a dynamic RPC mechanism. I believe it's worth preserving the effort and care that went into making this script by updating it to work with our current infrastructure. However, I am disabling the requirement for docstrings in this file. If you would like to help improve this script, please add docstrings alongside any refactors or rejuvenations you might apply at that time. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-7-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Turn that nice usage comment into a docstring. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-6-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
optparse isn't supported anymore, it's from the python2 days. Replace it with the mostly similar argparse. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-5-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Fixes: 50d189c9 These error classes aren't available anymore. Fix the bitrot. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-4-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
- Line length should be < 80 - You shouldn't perform unscoped imports except at the top of the module Notably, the sys.path hack creates problems with the import rule. This will be fixed later. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-3-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
Hint: > ln -s scripts/qmp/qemu-ga-client python/qemu/qmp/qemu_ga_client.py > cd python > isort qemu Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-2-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-
John Snow authored
The 'fuse' command will be unavailable if 'fusepy' is not installed. It will simply not load and subsequently be unavailable as a subcommand. Signed-off-by:
John Snow <jsnow@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-20-jsnow@redhat.com Signed-off-by:
John Snow <jsnow@redhat.com>
-