diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2022-01-28 16:11:57 +0000 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2022-02-23 17:07:26 -0500 |
commit | 5c66d7d8de9a00460199669d26cd83fba135bee5 (patch) | |
tree | 5c782624a6de5c4174dff51036afce6120960184 /python/setup.cfg | |
parent | 439125293cc9cfb684eb4db23db04199f5f435a2 (diff) | |
download | qemu-5c66d7d8de9a00460199669d26cd83fba135bee5.zip qemu-5c66d7d8de9a00460199669d26cd83fba135bee5.tar.gz qemu-5c66d7d8de9a00460199669d26cd83fba135bee5.tar.bz2 |
python: support recording QMP session to a file
When running QMP commands with very large response payloads, it is often
not easy to spot the info you want. If we can save the response to a
file then tools like 'grep' or 'jq' can be used to extract information.
For convenience of processing, we merge the QMP command and response
dictionaries together:
{
"arguments": {},
"execute": "query-kvm",
"return": {
"enabled": false,
"present": true
}
}
Example usage
$ ./scripts/qmp/qmp-shell-wrap -l q.log -p -- ./build/qemu-system-x86_64 -display none
Welcome to the QMP low-level shell!
Connected
(QEMU) query-kvm
{
"return": {
"enabled": false,
"present": true
}
}
(QEMU) query-mice
{
"return": [
{
"absolute": false,
"current": true,
"index": 2,
"name": "QEMU PS/2 Mouse"
}
]
}
$ jq --slurp '. | to_entries[] | select(.value.execute == "query-kvm") |
.value.return.enabled' < q.log
false
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20220128161157.36261-3-berrange@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/setup.cfg')
-rw-r--r-- | python/setup.cfg | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/setup.cfg b/python/setup.cfg index 0959603..9821db9 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -114,7 +114,10 @@ ignore_missing_imports = True # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". disable=consider-using-f-string, + consider-using-with, + too-many-arguments, too-many-function-args, # mypy handles this with less false positives. + too-many-instance-attributes, no-member, # mypy also handles this better. [pylint.basic] |