[honister,3/9] runfvp: handle the fvp quitting before we kill it

Message ID 20220426123359.22873-4-harry.moulton@arm.com
State New
Headers show
Series arm-bsp/machine: Backport runfvp config for Corstone1000 and update runfvp script | expand

Commit Message

harry.moulton@arm.com April 26, 2022, 12:33 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

Don't raise an exception if the FVP has quit before we get around to
killing it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
 scripts/runfvp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


diff --git a/scripts/runfvp b/scripts/runfvp
index 524de24d..877e80cb 100755
--- a/scripts/runfvp
+++ b/scripts/runfvp
@@ -179,7 +179,10 @@  async def start_fvp(cli, console_cb):
         # If we get cancelled or throw an exception, kill the FVP
         logger.debug(f"Killing FVP PID {fvp_process.pid}")
-        fvp_process.terminate()
+        try:
+            fvp_process.terminate()
+        except ProcessLookupError:
+            pass
     if await fvp_process.wait() != 0:
         logger.info(f"{cli[0]} quit with code {fvp_process.returncode}")