aboutsummaryrefslogtreecommitdiff
path: root/python/qemu/machine/machine.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/qemu/machine/machine.py')
-rw-r--r--python/qemu/machine/machine.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 14c4d17..8b93581 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -348,6 +348,11 @@ class QEMUMachine:
if self._qmp_connection:
self._qmp.accept(self._qmp_timer)
+ def _close_qemu_log_file(self) -> None:
+ if self._qemu_log_file is not None:
+ self._qemu_log_file.close()
+ self._qemu_log_file = None
+
def _post_shutdown(self) -> None:
"""
Called to cleanup the VM instance after the process has exited.
@@ -360,9 +365,7 @@ class QEMUMachine:
self._qmp.close()
self._qmp_connection = None
- if self._qemu_log_file is not None:
- self._qemu_log_file.close()
- self._qemu_log_file = None
+ self._close_qemu_log_file()
self._load_io_log()