diff options
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 0032f6ed8d..24af2fb20b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
@@ -342,7 +342,24 @@ class QemuRunner: | |||
342 | finally: | 342 | finally: |
343 | os.chdir(origpath) | 343 | os.chdir(origpath) |
344 | 344 | ||
345 | # Release the qemu porcess to continue running | 345 | # We worry that mmap'd libraries may cause page faults which hang the qemu VM for periods |
346 | # causing failures. Before we "start" qemu, read through it's mapped files to try and | ||
347 | # ensure we don't hit page faults later | ||
348 | mapdir = "/proc/" + str(self.qemupid) + "/map_files/" | ||
349 | try: | ||
350 | for f in os.listdir(mapdir): | ||
351 | linktarget = os.readlink(os.path.join(mapdir, f)) | ||
352 | if not linktarget.startswith("/") or linktarget.startswith("/dev") or "deleted" in linktarget: | ||
353 | continue | ||
354 | with open(linktarget, "rb") as readf: | ||
355 | data = True | ||
356 | while data: | ||
357 | data = readf.read(4096) | ||
358 | # Centos7 doesn't allow us to read /map_files/ | ||
359 | except PermissionError: | ||
360 | pass | ||
361 | |||
362 | # Release the qemu process to continue running | ||
346 | self.run_monitor('cont') | 363 | self.run_monitor('cont') |
347 | 364 | ||
348 | # We are alive: qemu is running | 365 | # We are alive: qemu is running |