Isn't the code waiting 5 seconds and then sending SIGKILL, regardless
of whether SIGTERM was successful or not here?

I would actually remove this function altogether. qemu process is
started by runqemu and it's the job of that to clean up the actual
qemu process properly.

Alex

On Thu, 9 Feb 2023 at 09:10, Mikko Rapeli <mikko.rap...@linaro.org> wrote:
>
> qemu doesn't always behave well and can hang too.
> kill it with force if was still alive.
>
> Signed-off-by: Mikko Rapeli <mikko.rap...@linaro.org>
> ---
>  meta/lib/oeqa/utils/qemurunner.py | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/meta/lib/oeqa/utils/qemurunner.py 
> b/meta/lib/oeqa/utils/qemurunner.py
> index bce00c696a..8e3484385d 100644
> --- a/meta/lib/oeqa/utils/qemurunner.py
> +++ b/meta/lib/oeqa/utils/qemurunner.py
> @@ -589,6 +589,13 @@ class QemuRunner:
>                  os.kill(self.qemupid, signal.SIGTERM)
>              except ProcessLookupError as e:
>                  self.logger.warning('qemu-system ended unexpectedly')
> +            time.sleep(5)
> +            try:
> +                # qemu-system did not behave well
> +                os.kill(self.qemupid, signal.SIGKILL)
> +            except ProcessLookupError as e:
> +                # already dead
> +                pass
>
>      def stop_thread(self):
>          if self.thread and self.thread.is_alive():
> --
> 2.34.1
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176935): 
https://lists.openembedded.org/g/openembedded-core/message/176935
Mute This Topic: https://lists.openembedded.org/mt/96849162/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to