diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2021-08-09 11:01:13 +0200 |
---|---|---|
committer | Hanna Reitz <hreitz@redhat.com> | 2021-09-01 12:57:31 +0200 |
commit | eb7a91d07ad831aeb372ff21b10e7a515ca786ec (patch) | |
tree | b34f487e9ea28774079d67292dbccb2540fd171e /python | |
parent | bd10a7397ed93be4ea97b1e377578d13922134f5 (diff) |
qemu-iotests: add option to show qemu binary logs on stdout
Using the flag -p, allow the qemu binary to print to stdout.
Also create the common function _close_qemu_log_file() to
avoid accessing machine.py private fields directly and have
duplicate code.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210809090114.64834-16-eesposit@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'python')
-rw-r--r-- | python/qemu/machine/machine.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 14c4d17eca..8b935813e9 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() |