[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] python/qemu: Kill QEMU process if 'quit' doesn't work
From: |
John Snow |
Subject: |
Re: [PATCH 2/3] python/qemu: Kill QEMU process if 'quit' doesn't work |
Date: |
Mon, 16 Mar 2020 15:57:43 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/13/20 4:36 AM, Kevin Wolf wrote:
> With a QEMU bug, it can happen that the QEMU process doesn't react to a
> 'quit' QMP command. If we got an exception during previous QMP
> communication (e.g. iotests Timeout expiring), we could also be in an
> inconsistent state where after sending 'quit' we immediately read an old
> response and close the socket even though the 'quit' command wasn't
> processed yet. Both cases would lead to a hanging test.
>
> Fix this by waiting for the QEMU process to exit after sending 'quit'
> with a timeout, and if it doesn't happen within three seconds, send
> SIGKILL.
>
> Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: John Snow <address@hidden>
> ---
> python/qemu/machine.py | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/python/qemu/machine.py b/python/qemu/machine.py
> index 183d8f3d38..c837ee8723 100644
> --- a/python/qemu/machine.py
> +++ b/python/qemu/machine.py
> @@ -358,6 +358,7 @@ class QEMUMachine(object):
> if not has_quit:
> self._qmp.cmd('quit')
> self._qmp.close()
> + self._popen.wait(timeout=3)
> except:
> self._popen.kill()
> self._popen.wait()
>
--
—js
- [PATCH 0/3] iotests: Fix intermittent 030 hang, Kevin Wolf, 2020/03/13
- [PATCH 1/3] iotests.py: Enable faulthandler, Kevin Wolf, 2020/03/13
- [PATCH 2/3] python/qemu: Kill QEMU process if 'quit' doesn't work, Kevin Wolf, 2020/03/13
- [PATCH 3/3] iotests: Increase pause_wait() timeout, Kevin Wolf, 2020/03/13
- Re: [PATCH 0/3] iotests: Fix intermittent 030 hang, Philippe Mathieu-Daudé, 2020/03/20
- Re: [PATCH 0/3] iotests: Fix intermittent 030 hang, Peter Maydell, 2020/03/22