xemu/python/qemu
Kevin Wolf cd87f5e378 python/qemu: Kill QEMU process if 'quit' doesn't work
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 <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200313083617.8326-3-kwolf@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-03-21 22:37:32 +00:00
..
__init__.py python/qemu: Remove unneeded imports in __init__ 2019-12-16 18:39:51 -05:00
accel.py python/qemu: accel: Fix kvm_available() on ppc64le 2020-02-07 15:12:48 +01:00
machine.py python/qemu: Kill QEMU process if 'quit' doesn't work 2020-03-21 22:37:32 +00:00
qmp.py python/qemu/qmp.py: QMP debug with VM label 2020-03-17 17:55:57 -04:00
qtest.py iotests.py: Store socket files in $SOCK_DIR 2019-10-28 11:22:30 +01:00