On 3/23/22 10:22, Alex Bennée wrote:
Richard Henderson <richard.hender...@linaro.org> writes:
Inside qemu_log, we perform qemu_log_lock/unlock, which need
not be done if we have already performed the lock beforehand.
Always check the result of qemu_log_lock -- only checking
qemu_loglevel_mask races with the acquisition of the lock
on the logfile.
I'm not sure I like introducing all these raw fprintfs over introducing
a function like qemu_log__locked().
There's no way to implement qemu_log__locked with rcu. The lookup itself is what needs
the locking; the return value of the FILE* is then valid until the unlock. To lookup the
FILE* again would require more atomic operations.
And I do prefer the printfs over repeated qemu_log.
r~