diff options
author | Cleber Rosa | 2021-02-11 23:01:41 +0100 |
---|---|---|
committer | Cleber Rosa | 2021-02-16 03:40:16 +0100 |
commit | 3c1e16c60c72e8f11a15d63e9d4a2fd33be6b106 (patch) | |
tree | dc2701498a498769bebb9bd3a92d545c0709c96a /python/qemu | |
parent | virtiofs_submounts.py test: Note on vmlinuz param (diff) | |
download | qemu-3c1e16c60c72e8f11a15d63e9d4a2fd33be6b106.tar.gz qemu-3c1e16c60c72e8f11a15d63e9d4a2fd33be6b106.tar.xz qemu-3c1e16c60c72e8f11a15d63e9d4a2fd33be6b106.zip |
Python: close the log file kept by QEMUMachine before reading it
Closing a file that is open for writing, and then reading from it
sounds like a better idea than the opposite, given that the content
will be flushed.
Reference: https://docs.python.org/3/library/io.html#io.IOBase.close
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20210211220146.2525771-2-crosa@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Diffstat (limited to 'python/qemu')
-rw-r--r-- | python/qemu/machine.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 7a40f4604b..6e44bda337 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -337,12 +337,12 @@ class QEMUMachine: self._qmp.close() self._qmp_connection = None - self._load_io_log() - if self._qemu_log_file is not None: self._qemu_log_file.close() self._qemu_log_file = None + self._load_io_log() + self._qemu_log_path = None if self._temp_dir is not None: |