diff options
author | Ross Burton <ross@burtonini.com> | 2021-12-08 17:02:30 +0000 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2021-12-10 11:33:49 +0800 |
commit | 48bd07808672fe84a452a5b0f4f4b6ff7daa32ae (patch) | |
tree | 67437b2f4e0f257582ea74038b02ff8753f6d1e2 | |
parent | a2bbdb02bdf50e4d7dc1a2439b562a50584b63b9 (diff) | |
download | openembedded-core-contrib-48bd07808672fe84a452a5b0f4f4b6ff7daa32ae.tar.gz |
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 ]
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0f3afbd3a6a6bef668612f818517df7543c0a683)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rwxr-xr-x | scripts/runqemu | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index c467b0eb19..66e035c9af 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1580,7 +1580,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"]) |