[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/8] tests/qtest: fix registration of ABRT handler for QEMU cleanu
From: |
Thomas Huth |
Subject: |
[PULL 3/8] tests/qtest: fix registration of ABRT handler for QEMU cleanup |
Date: |
Wed, 18 May 2022 11:04:33 +0200 |
From: Daniel P. Berrangé <berrange@redhat.com>
qtest_init registers a hook to cleanup the running QEMU process
should g_assert() fire before qtest_quit is called. When the first
hook is registered, it is supposed to triggere registration of the
SIGABRT handler. Unfortunately the logic in hook_list_is_empty is
inverted, so the SIGABRT handler never gets registered, unless
2 or more QEMU processes are run concurrently. This caused qtest
to leak QEMU processes anytime g_assert triggers.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220513154906.206715-2-berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/libqtest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 228357f1ea..4a4697c0d1 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -197,11 +197,11 @@ static bool hook_list_is_empty(GHookList *hook_list)
GHook *hook = g_hook_first_valid(hook_list, TRUE);
if (!hook) {
- return false;
+ return true;
}
g_hook_unref(hook_list, hook);
- return true;
+ return false;
}
void qtest_add_abrt_handler(GHookFunc fn, const void *data)
--
2.27.0
- [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Thomas Huth, 2022/05/18
- [PULL 7/8] capstone: Allow version 3.0.5 again, Thomas Huth, 2022/05/18
- [PULL 2/8] Remove Ubuntu 18.04 container support from the repository, Thomas Huth, 2022/05/18
- [PULL 5/8] docs/about: Update the support statement for Windows, Thomas Huth, 2022/05/18
- [PULL 1/8] gitlab-ci: Switch the container of the 'check-patch' & 'check-dco' jobs, Thomas Huth, 2022/05/18
- [PULL 6/8] tests/vm: Add capstone to the NetBSD and OpenBSD VMs, Thomas Huth, 2022/05/18
- [PULL 3/8] tests/qtest: fix registration of ABRT handler for QEMU cleanup,
Thomas Huth <=
- [PULL 8/8] capstone: Remove the capstone submodule, Thomas Huth, 2022/05/18
- [PULL 4/8] tests/qtest: use prctl(PR_SET_PDEATHSIG) as fallback to kill QEMU, Thomas Huth, 2022/05/18
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Richard Henderson, 2022/05/18
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Thomas Huth, 2022/05/19
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Stefan Hajnoczi, 2022/05/19
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Daniel P . Berrangé, 2022/05/19
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Peter Maydell, 2022/05/19
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Thomas Huth, 2022/05/20
- Re: [PULL 0/8] Misc patches (Gitlab-CI, qtest, Capstone, ...), Richard Henderson, 2022/05/20