summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorTrevor Gamblin <trevor.gamblin@windriver.com>2020-02-07 08:46:52 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-07 10:56:45 +0000
commitb61d8bc577cd76eb506d15a2c4c4e9016f0c20c5 (patch)
tree4111b4f272f8281ff70358fae09ccb81515e871f /meta/lib
parentceda1b23f2210d736173acbef65302eb40f0c9ad (diff)
downloadpoky-b61d8bc577cd76eb506d15a2c4c4e9016f0c20c5.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] (From OE-Core rev: 0e94cfb4aa718b4842f608879b77d5671b5bf338) Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit eadb899e23b18eb9eaff145c3bf5b20fb417c3e8) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index fe8b77d97a..0d63e44ea7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -396,7 +396,10 @@ class QemuRunner:
396 self.qemupid = None 396 self.qemupid = None
397 self.ip = None 397 self.ip = None
398 if os.path.exists(self.qemu_pidfile): 398 if os.path.exists(self.qemu_pidfile):
399 os.remove(self.qemu_pidfile) 399 try:
400 os.remove(self.qemu_pidfile)
401 except FileNotFoundError as e:
402 self.logger.warning('qemu pidfile is no longer present')
400 if self.monitorpipe: 403 if self.monitorpipe:
401 self.monitorpipe.close() 404 self.monitorpipe.close()
402 405