=== modified file 'lava_dispatcher/device/fastmodel.py'
@@ -46,6 +46,7 @@
ensure_directory,
extract_targz,
DrainConsoleOutput,
+ finalize_process,
)
@@ -244,9 +245,8 @@
def power_off(self, proc):
super(FastModelTarget, self).power_off(proc)
- if self._sim_proc is not None:
- self._sim_proc.close()
- self._sim_proc = None
+ finalize_process(self._sim_proc)
+ self._sim_proc = None
def _create_rtsm_ostream(self, ofile):
"""the RTSM binary uses the windows code page(cp1252), but the
=== modified file 'lava_dispatcher/device/qemu.py'
@@ -36,6 +36,7 @@
from lava_dispatcher.utils import (
ensure_directory,
extract_targz,
+ finalize_process,
)
@@ -77,9 +78,7 @@
return proc
def power_off(self, proc):
- if proc:
- proc.kill(9)
- proc.close()
+ finalize_process(proc)
def get_device_version(self):
try:
=== modified file 'lava_dispatcher/utils.py'
@@ -270,3 +270,9 @@
"{time.tm_hour:02}:{time.tm_min:02}:{time.tm_sec:02}Z").format(
test_id=test_name,
time=datetime.datetime.utcnow().timetuple())
+
+def finalize_process(proc):
+ print("*** finalize_process ***")
+ if proc:
+ proc.kill(9)
+ proc.close()