diff options
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 6927456b29..21bc35a32c 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
@@ -296,6 +296,7 @@ class QemuRunner: | |||
296 | 296 | ||
297 | def stop(self): | 297 | def stop(self): |
298 | self.stop_thread() | 298 | self.stop_thread() |
299 | self.stop_qemu_system() | ||
299 | if hasattr(self, "origchldhandler"): | 300 | if hasattr(self, "origchldhandler"): |
300 | signal.signal(signal.SIGCHLD, self.origchldhandler) | 301 | signal.signal(signal.SIGCHLD, self.origchldhandler) |
301 | if self.runqemu: | 302 | if self.runqemu: |
@@ -320,6 +321,14 @@ class QemuRunner: | |||
320 | self.qemupid = None | 321 | self.qemupid = None |
321 | self.ip = None | 322 | self.ip = None |
322 | 323 | ||
324 | def stop_qemu_system(self): | ||
325 | if self.qemupid: | ||
326 | try: | ||
327 | # qemu-system behaves well and a SIGTERM is enough | ||
328 | os.kill(self.qemupid, signal.SIGTERM) | ||
329 | except ProcessLookupError as e: | ||
330 | logger.warn('qemu-system ended unexpectedly') | ||
331 | |||
323 | def stop_thread(self): | 332 | def stop_thread(self): |
324 | if self.thread and self.thread.is_alive(): | 333 | if self.thread and self.thread.is_alive(): |
325 | self.thread.stop() | 334 | self.thread.stop() |