+
  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


Reply via email to