From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Yury Kotov <yury-kotov@yandex-team.ru>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] tests/qtest/libqtest: Do not overwrite child coredump
Date: Tue, 7 Jul 2020 11:03:31 +0200 [thread overview]
Message-ID: <9a16d2d9-405c-2110-debe-c92b8dbece33@redhat.com> (raw)
In-Reply-To: <20200707031920.17428-1-f4bug@amsat.org>
On 07/07/2020 05.19, Philippe Mathieu-Daudé wrote:
> We are interested by the coredump of the child, not the qtest
> parent. If the child generated a coredump, simply call
> exit(EXIT_FAILURE) in the parent to avoid overwriting the
> child coredump.
>
> Fixes: 71a268a5fd ("tests/libqtest: Improve kill_qemu()")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> tests/qtest/libqtest.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 49075b55a1..bd85d01145 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -173,7 +173,12 @@ static void kill_qemu(QTestState *s)
> fprintf(stderr, "%s:%d: kill_qemu() detected QEMU death "
> "from signal %d (%s)%s\n",
> __FILE__, __LINE__, sig, signame, dump);
> - abort();
> + if (WCOREDUMP(wstatus)) {
> + /* Preserve child coredump */
> + exit(1);
> + } else {
> + abort();
> + }
> }
> }
Would it maybe rather make sense to always use exit(1) unconditionally here?
Thomas
next prev parent reply other threads:[~2020-07-07 9:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 3:19 [PATCH] tests/qtest/libqtest: Do not overwrite child coredump Philippe Mathieu-Daudé
2020-07-07 9:03 ` Thomas Huth [this message]
2020-07-07 9:29 ` Paolo Bonzini
2020-07-07 13:32 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a16d2d9-405c-2110-debe-c92b8dbece33@redhat.com \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=f4bug@amsat.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=yury-kotov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).