Skip to contentSkip to conversation

runqemu: check the qemu PID has been set before kill()ing it

PATCH New Ross Burton 1 participant 1 message Dec 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu: check the qemu PID has been set before kill()ing it

If runqemu is killed, check that we have a valid PID for the qemu before sending a kill() to it.

[ YOCTO #14651 ]

---
 scripts/runqemu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/runqemu +2 -1
index efb98ab9e0f..410d2a9939b 100755
@@ -1593,7 +1593,8 @@ def main():
 
         def sigterm_handler(signum, frame):
             logger.info("SIGTERM received")
-            os.kill(config.qemupid, signal.SIGTERM)
+            if config.qemupid:
+                os.kill(config.qemupid, signal.SIGTERM)
             config.cleanup()
             # Deliberately ignore the return code of 'tput smam'.
             subprocess.call(["tput", "smam"])
Signature · 1 line
2.25.1