summary refs log tree commit diff stats
path: root/python/qemu/machine/console_socket.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-06-07 16:06:38 -0400
committerJohn Snow <jsnow@redhat.com>2021-06-18 16:10:07 -0400
commitd1d14e59895b2ebd2953e9442225ffba56f80e9b (patch)
treea5c4f18078a3a171802094f5195c7343b921b48f /python/qemu/machine/console_socket.py
parenteac8aabc92f80d9a41d9f01163921472e309334c (diff)
downloadfocaccia-qemu-d1d14e59895b2ebd2953e9442225ffba56f80e9b.tar.gz
focaccia-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 'python/qemu/machine/console_socket.py')
0 files changed, 0 insertions, 0 deletions