diff options
author | John Snow | 2021-06-07 22:06:38 +0200 |
---|---|---|
committer | John Snow | 2021-06-18 22:10:07 +0200 |
commit | d1d14e59895b2ebd2953e9442225ffba56f80e9b (patch) | |
tree | a5c4f18078a3a171802094f5195c7343b921b48f /scripts/qemu-version.sh | |
parent | python/qmp: return generic type from context manager (diff) | |
download | qemu-d1d14e59895b2ebd2953e9442225ffba56f80e9b.tar.gz qemu-d1d14e59895b2ebd2953e9442225ffba56f80e9b.tar.xz qemu-d1d14e59895b2ebd2953e9442225ffba56f80e9b.zip |
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>
Diffstat (limited to 'scripts/qemu-version.sh')
0 files changed, 0 insertions, 0 deletions