|
From: | Emanuele Giuseppe Esposito |
Subject: | Re: [PATCH v4 14/15] qemu-iotests: add option to show qemu binary logs on stdout |
Date: | Fri, 28 May 2021 22:32:11 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
+ imgfmt = os.environ.get('IMGFMT', 'raw') imgproto = os.environ.get('IMGPROTO', 'file') output_dir = os.environ.get('OUTPUT_DIR', '.') @@ -614,6 +616,13 @@ def _post_shutdown(self) -> None: super()._post_shutdown() self.subprocess_check_valgrind(qemu_valgrind) + def _pre_launch(self) -> None: + super()._pre_launch() + if qemu_print and self._qemu_log_file is not None: + # set QEMU binary output to stdout + self._qemu_log_file.close() + self._qemu_log_file = None +So, many use of _private members actually show that proper way of doing this is adding an option to __init__ instead
And then add yet another bool variable in __init__ just to mark when use the log file or not? At this point, if we really don't want this here we can just create a public function in machine.py and call that...
This can also be shared with machine.py's _post_shutdown().
Interesting will pylint complain on using _private members outside of the home class?
No, test 297 tests it and prints no warning or error. Thank you, Emanuele
[Prev in Thread] | Current Thread | [Next in Thread] |