diff options
author | Ross Burton <ross@burtonini.com> | 2021-12-08 17:02:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-15 07:40:29 +0000 |
commit | 884efa83d6d420e5e7ce06fe8c871e3f841e442b (patch) | |
tree | ea0e00eef635c6d90b24f2893715b9643e681a22 /scripts | |
parent | a96b0ad6eb9be742d640638ddd4a9d875d7694c4 (diff) | |
download | poky-884efa83d6d420e5e7ce06fe8c871e3f841e442b.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 ]
(From OE-Core rev: 7e37e453e15114dec0b89636e92f93c7fa127ae4)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index f3527a4412..f9a1a0da32 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1573,7 +1573,8 @@ def main(): | |||
1573 | 1573 | ||
1574 | def sigterm_handler(signum, frame): | 1574 | def sigterm_handler(signum, frame): |
1575 | logger.info("SIGTERM received") | 1575 | logger.info("SIGTERM received") |
1576 | os.kill(config.qemupid, signal.SIGTERM) | 1576 | if config.qemupid: |
1577 | os.kill(config.qemupid, signal.SIGTERM) | ||
1577 | config.cleanup() | 1578 | config.cleanup() |
1578 | # Deliberately ignore the return code of 'tput smam'. | 1579 | # Deliberately ignore the return code of 'tput smam'. |
1579 | subprocess.call(["tput", "smam"]) | 1580 | subprocess.call(["tput", "smam"]) |