On 11 February 2013 14:57, Stefan Hajnoczi <stefa...@gmail.com> wrote: > On Mon, Feb 11, 2013 at 3:34 PM, Peter Maydell <peter.mayd...@linaro.org> > wrote: >> On 11 February 2013 14:19, Andreas Färber <afaer...@suse.de> wrote: >>> Blue already did some work to make it more usable, and I believe Peter >>> adopted LOG_UNIMPL for ARM devices in place of hw_error() >> >> Yes; in particular where we have classes of error message which the >> user may wish to enable or disable (of which "QEMU doesn't implement >> this" and "the guest just did something that's probably a guest bug" >> are two common ones) qemu_log_mask(LOG_*, ...) is the preferred >> API for devices IMHO. So I think Herve's patch is entirely the >> right thing. > > qemu_log_mask() can replace fprintf() but it needs to default to > stderr and a reasonable default mask.
Feel free to send in a patch... Also, which errors did you want to enable by default? At the moment none of the categories are IMHO reasonable to default to enabled. > It should be used for non-monitor command errors and warnings. > > Having said that, I think we should use hw_error() or fprintf() in > this patch until qemu_log_mask() replaces them. It will never replace them unless we start accepting patches like this that use qemu_log_mask() in the places where it is appropriate. -- PMM