diff options
author | Trevor Gamblin <trevor.gamblin@windriver.com> | 2020-02-07 08:46:52 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-08 13:19:56 +0000 |
commit | eadb899e23b18eb9eaff145c3bf5b20fb417c3e8 (patch) | |
tree | 4980c3153022d927b4c42fa7af17d5d2fda0f8fd | |
parent | 84eb1dc4fe8a11cd2d05b703070a6fb6de05b873 (diff) | |
download | openembedded-core-contrib-eadb899e23b18eb9eaff145c3bf5b20fb417c3e8.tar.gz |
qemurunner.py: add try/except for pid handling race
In some instances, attempts to remove the qemu pidfile within the
stop() method fail despite the os.path.exists() call immediately
before implying that the file is present. Add a try/except block
to log a warning if this occurs, rather than failing outright,
since the process simply appears to be exiting at an inconvenient
time.
[YOCTO #13675]
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 2cada35d48..4704422211 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -406,7 +406,10 @@ class QemuRunner: self.qemupid = None self.ip = None if os.path.exists(self.qemu_pidfile): - os.remove(self.qemu_pidfile) + try: + os.remove(self.qemu_pidfile) + except FileNotFoundError as e: + self.logger.warning('qemu pidfile is no longer present') if self.monitorpipe: self.monitorpipe.close() |