On 17/01/2023 09.07, Paolo Bonzini wrote:
If a test aborts after qtest_wait_qemu() is called, the SIGABRT hooks are
still in place and waitpid() is called again. The second time it is called,
the process does not exist anymore and the system call fails.
Move the s->qemu_pid = -1 assignment to qtest_wait_qemu() to make it
idempotent, and anyway remove the SIGABRT hook as well to avoid that
qtest_check_status() is called twice. Because of the extra call,
qtest_remove_abrt_handler() now has to be made idempotent as well.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
tests/qtest/libqtest.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
Reviewed-by: Thomas Huth <th...@redhat.com>