aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index e0ca19dbfe..098af6aec4 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -103,8 +103,15 @@ static int socket_accept(int sock)
static void kill_qemu(QTestState *s)
{
if (s->qemu_pid != -1) {
+ int wstatus = 0;
+ pid_t pid;
+
kill(s->qemu_pid, SIGTERM);
- waitpid(s->qemu_pid, NULL, 0);
+ pid = waitpid(s->qemu_pid, &wstatus, 0);
+
+ if (pid == s->qemu_pid && WIFSIGNALED(wstatus)) {
+ assert(!WCOREDUMP(wstatus));
+ }
}
}