From: Fabien Chouteau <chouteau@adacore.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, agraf@suse.de,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state
Date: Tue, 15 May 2012 18:45:23 +0200 [thread overview]
Message-ID: <4FB28823.8050908@adacore.com> (raw)
In-Reply-To: <CAFEAcA-VNDRg+=+bKxPVRWyQRohk3KXZRBOjWq1yv8Wu8jUbwg@mail.gmail.com>
On 05/15/2012 06:20 PM, Peter Maydell wrote:
> On 15 May 2012 17:08, Fabien Chouteau <chouteau@adacore.com> wrote:
>> On 05/15/2012 03:31 PM, Andreas Färber wrote:
>>> Am 15.05.2012 11:39, schrieb Fabien Chouteau:
>>>> Do not call cpu_dump_state if logfile is NULL.
>>>
>>> And where is log_cpu_state() being called from? Its caller is passing
>>> NULL already then.
>
>> No, logfile is a global variable. log_cpu_state() takes only CPUState
>> and flags parameters.
>
> The question is which of the following two options we want:
> (1) callers should be guarding the calls to log_cpu_state() with
> checks for qemu_log_enabled() or qemu_loglevel_mask()
> (2) log_cpu_state() does its own check for whether logging is enabled
> in the same way that qemu_log() and qemu_log_vprintf() do
>
> At the moment most callers of log_cpu_state() do their own checks
> as per (1), but you could make an argument that we should switch
> to (2) instead.
>
I think (2) is better, we do the check in one place and that's it. All
call to log_cpu_state are safe. And as you said, it's already the way
qemu_log and qemu_log_vprintf work.
--
Fabien Chouteau
next prev parent reply other threads:[~2012-05-15 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 14:46 [Qemu-devel] [PATCH] PowerPC: Avoid segfault in cpu_dump_state Fabien Chouteau
2012-05-14 15:39 ` Peter Maydell
2012-05-15 9:39 ` [Qemu-devel] [PATCH] " Fabien Chouteau
2012-05-15 13:31 ` Andreas Färber
2012-05-15 16:08 ` Fabien Chouteau
2012-05-15 16:20 ` Peter Maydell
2012-05-15 16:45 ` Fabien Chouteau [this message]
2012-05-15 18:04 ` Peter Maydell
2012-05-16 3:50 ` Andreas Färber
2012-05-16 8:29 ` Fabien Chouteau
2012-05-16 13:39 ` Fabien Chouteau
2012-05-23 15:43 ` Fabien Chouteau
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=4FB28823.8050908@adacore.com \
--to=chouteau@adacore.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).