e6de9ce9 | 04-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qemu-ga-client: Fix exception handling
Fixes: 50d189c
These error classes aren't available anymore. Fix the bitrot.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210604155532.1
scripts/qemu-ga-client: Fix exception handling
Fixes: 50d189c
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>
show more ...
|
e75f516a | 04-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qemu-ga-client: apply (most) flake8 rules
- 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 w
scripts/qemu-ga-client: apply (most) flake8 rules
- 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>
show more ...
|
c89b38cd | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py
By leaving the script absent for a commit, git-blame travels to the new file instead of staying on the shim.
Signed-off-by: Joh
scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py
By leaving the script absent for a commit, git-blame travels to the new file instead of staying on the shim.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-19-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
30ec845c | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: add static type hints
Because fusepy does not have type hints, add some targeted warning suppressions.
Namely, we need to allow subclassing something of an unknown type (in qom_fu
scripts/qom-fuse: add static type hints
Because fusepy does not have type hints, add some targeted warning suppressions.
Namely, we need to allow subclassing something of an unknown type (in qom_fuse.py), and we need to allow missing imports (recorded against fuse itself) because mypy will be unable to import fusepy (even when installed) as it has no types nor type stubs available.
Note: Until now, it was possible to run invocations like 'mypy qemu/' from ./python and have that work. However, these targeted suppressions require that you run 'mypy -p qemu/' instead. The correct, canonical invocation is recorded in ./python/tests/mypy.sh and all of the various CI invocations always use this correct form.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-16-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
2cea7134 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: ensure QOMFuse.read always returns bytes
- Use FuseOSError to signal ENOENT instead of returning it - Wrap qom-get in str(), as we don't always know its type - The empty return sho
scripts/qom-fuse: ensure QOMFuse.read always returns bytes
- Use FuseOSError to signal ENOENT instead of returning it - Wrap qom-get in str(), as we don't always know its type - The empty return should be b'', not ''.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-15-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
9ec8a386 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: use QOMCommand.qom_list()
the qom_list method provides a type-safe object that's easier to type check, so switch to using it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-
scripts/qom-fuse: use QOMCommand.qom_list()
the qom_list method provides a type-safe object that's easier to type check, so switch to using it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-14-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
2aa10179 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: Convert to QOMCommand
Move qom-fuse onto the QOMCommand base established in python/qemu/qmp/qom_common.py. The interface doesn't change incompatibly, "qom-fuse mountpoint" still wo
scripts/qom-fuse: Convert to QOMCommand
Move qom-fuse onto the QOMCommand base established in python/qemu/qmp/qom_common.py. The interface doesn't change incompatibly, "qom-fuse mountpoint" still works as an invocation, and QMP_SOCKET is still used as the environment variable.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-13-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
187be27c | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: Add docstrings
The methods inherited from fuse don't need docstrings; that's up to fusepy to handle.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369
scripts/qom-fuse: Add docstrings
The methods inherited from fuse don't need docstrings; that's up to fusepy to handle.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210603003719.1321369-12-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
7552823a | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: Apply pylint rules
- Catch specific exceptions from QMP - Reraise errors with explicit context - method parameters should match parent's names
Signed-off-by: John Snow <jsnow@redh
scripts/qom-fuse: Apply pylint rules
- Catch specific exceptions from QMP - Reraise errors with explicit context - method parameters should match parent's names
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-11-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
26c1ccad | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: apply flake8 rules
flake8 still has one warning because of the sys.path hack, but that will be going away by the end of this patch series.
Signed-off-by: John Snow <jsnow@redhat.c
scripts/qom-fuse: apply flake8 rules
flake8 still has one warning because of the sys.path hack, but that will be going away by the end of this patch series.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-9-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
c6b7eae9 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qom-fuse: apply isort rules
Hint: you can use symlinks to create qom_fuse.py in python/qemu/qmp/ and point to scripts/qom-fuse to apply the standard linting rules to this script.
Signed-off
scripts/qom-fuse: apply isort rules
Hint: you can use symlinks to create qom_fuse.py in python/qemu/qmp/ and point to scripts/qom-fuse to apply the standard linting rules to this script.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
908ff4b2 | 02-Jun-2021 |
John Snow <jsnow@redhat.com> |
scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/
Redirect to the new qom scripts. These forwarders can be deleted eventually when there has been more time for the dust on the Python packagi
scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/
Redirect to the new qom scripts. These forwarders can be deleted eventually when there has been more time for the dust on the Python packaging to settle and people understand how to find these commands.
Note: You can run these by setting $PYTHONPATH in your shell and then running "python3 -m qemu.qmp.qom", or you can install the qemu namespace package and use the "qom" or "qom-set" scripts.
I've written how to install the package elsewhere, but for the sake of git-blame, cd to ./python, and then do:
- pip3 install [--user] [-e] .
--user will install to your local user install (will not work inside of a venv), omitting this flag installs to your system-wide packages (outside of a venv) or to your current virtual environment (inside the venv).
When installing to a venv or to your system-wide packages, "qom" should be in your $PATH already. If you do a user install, you may need to add ~/.local/bin to your $PATH if you haven't already.
-e installs in editable mode: the installed package is effectively just a symlink to this folder; so changes to your git working tree are reflected in the installed package.
Note: installing these packages to an environment outside a venv can be dangerous: Many QEMU scripts will begin to prefer the installed version instead of the version directly in the tree. Use with caution. editable mode is recommended when working outside of a venv.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210603003719.1321369-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
36006046 | 19-Oct-2020 |
John Snow <jsnow@redhat.com> |
scripts/qmp: delete 'qmp' script
This script has not seen a patch that was specifically for this script since it was moved to this location in 2013, and I doubt it is used. It uses "man qmp" for its
scripts/qmp: delete 'qmp' script
This script has not seen a patch that was specifically for this script since it was moved to this location in 2013, and I doubt it is used. It uses "man qmp" for its help message, which does not exist. It also presumes there is a manual page for qmp-XXX, for each defined qmp command XXX. I don't think that's true.
The format it expects arguments in is something like:
block-dirty-bitmap-add --node=foo --name=bar
and has no capacity to support nested JSON arguments, either.
Most developers use either qmp-shell or socat (or pasting JSON directly into qmp stdio), so this duplication and additional alternate syntax is not helpful.
Remove it. Leave a breadcrumb script just in case, to be removed next release cycle.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20201019210430.1063390-1-jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
3a14019e | 23-Jul-2020 |
Markus Armbruster <armbru@redhat.com> |
scripts/qmp/qom-fuse: Fix getattr(), read() for files in /
path, prop = "type".rsplit('/', 1) sets path to "", which doesn't work. Correct to "/".
Signed-off-by: Markus Armbruster <armbru@redhat.c
scripts/qmp/qom-fuse: Fix getattr(), read() for files in /
path, prop = "type".rsplit('/', 1) sets path to "", which doesn't work. Correct to "/".
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
f713ed4f | 23-Jul-2020 |
Markus Armbruster <armbru@redhat.com> |
scripts/qmp/qom-fuse: Port to current Python module fuse
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-3-armbru@redhat.com> Reviewed-by: John Snow <jsnow@r
scripts/qmp/qom-fuse: Port to current Python module fuse
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-3-armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
2d110c11 | 13-May-2020 |
John Snow <jsnow@redhat.com> |
python: remove more instances of sys.version_info
We guarantee 3.5+ everywhere; remove more dead checks. In general, try to avoid using version checks and instead prefer to attempt behavior when pos
python: remove more instances of sys.version_info
We guarantee 3.5+ everywhere; remove more dead checks. In general, try to avoid using version checks and instead prefer to attempt behavior when possible.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200514035230.25756-1-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
show more ...
|
c7b942d7 | 28-May-2020 |
John Snow <jsnow@redhat.com> |
scripts/qmp: Fix shebang and imports
There's more wrong with these scripts; They are in various stages of disrepair. That's beyond the scope of this current patchset.
This just mechanically correct
scripts/qmp: Fix shebang and imports
There's more wrong with these scripts; They are in various stages of disrepair. That's beyond the scope of this current patchset.
This just mechanically corrects the imports and the shebangs, as part of ensuring that the python/qemu/lib refactoring didn't break anything needlessly.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20200528222129.23826-2-jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
show more ...
|