On 15 May 2012 17:45, Fabien Chouteau <chout...@adacore.com> wrote: > On 05/15/2012 06:20 PM, Peter Maydell wrote: >> 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.
Yeah, it seems reasonable to me. I think your commit message could be better though, since you're actually kind of changing an API here, not just fixing a segfault bug. -- PMM