qemu/scripts/qmp
John Snow d1d14e5989 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>
2021-06-18 16:10:07 -04:00
..
qemu-ga-client scripts/qemu-ga-client: Add forwarder shim 2021-06-18 16:10:06 -04:00
qmp scripts/qmp: delete 'qmp' script 2020-10-27 11:11:06 +01:00
qmp-shell scripts/qmp-shell: Use context manager instead of atexit 2021-06-18 16:10:07 -04:00
qom-fuse scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py 2021-06-18 16:10:06 -04:00
qom-get scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ 2021-06-18 16:10:06 -04:00
qom-list scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ 2021-06-18 16:10:06 -04:00
qom-set scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ 2021-06-18 16:10:06 -04:00
qom-tree scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/ 2021-06-18 16:10:06 -04:00