From: Zhao Liu <zhao1.liu@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: no-reply@patchew.org, qemu-devel@nongnu.org,
Zhao Liu <zhao1.liu@intel.com>
Subject: Re: [RFC] util/error-report: Add "error: " prefix for error-level report
Date: Sat, 30 Mar 2024 01:15:25 +0800 [thread overview]
Message-ID: <Zgb3LWIBfco0eyf8@intel.com> (raw)
In-Reply-To: <CABgObfb8EP+LZV8jF7sumQd2-hR1WTN-MCmcrK-NO0rGJu3b4g@mail.gmail.com>
Hi Paolo,
On Fri, Mar 29, 2024 at 12:10:17PM +0100, Paolo Bonzini wrote:
> Date: Fri, 29 Mar 2024 12:10:17 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: Re: [RFC] util/error-report: Add "error: " prefix for error-level
> report
>
> On Fri, Mar 29, 2024 at 10:37 AM <no-reply@patchew.org> wrote:
> > > This was done in the context of inheriting the original error_report()
> > > interface without the prefix style. And it was also useful to have a
> > > means of error handling, such as exit(), when error occurs, so that the
> > > error message - the most serious level - can be noticed by the user.
> > >
> > > Nowadays, however, error_report() and its variants have a tendency to be
> > > "abused": it is used a lot just for the sake of logging something more
> > > noticeable than the "warn" or "info" level, in the absence of
> > > appropriate error handling logic.
>
> Unfortunately, this is the reason why you _cannot_ do what this patch does.
>
> For example:
>
> error_reportf_err(local_err, "Disconnect client, due to: ");
> error_report("terminating on signal %d", shutdown_signal);
>
> This should not be prepending "error" - it's not an error.
So I feel these 2 cases maybe should use info_report()?
> error_report_once("%s: detected read error on DMAR slpte "
>
> This is a guest error, so "error:" is probably not a good idea (it
> should use qemu_log_mask).
Yes, here I can do a cleanup.
> And so on. :(
error_report() and its variants have 2600+ use cases, and it's
impossible to distinguish whether ther're appropriate or not.
Thanks for your explanation, I understand this is not workable,
since there is too heavy the debt to sort out error_report().
Regards,
Zhao
prev parent reply other threads:[~2024-03-29 17:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 11:46 [RFC] util/error-report: Add "error: " prefix for error-level report Zhao Liu
2024-03-27 12:36 ` Thomas Huth
2024-03-27 13:02 ` Zhao Liu
2024-03-29 11:10 ` Paolo Bonzini
2024-03-29 17:15 ` Zhao Liu [this message]
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=Zgb3LWIBfco0eyf8@intel.com \
--to=zhao1.liu@linux.intel.com \
--cc=no-reply@patchew.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhao1.liu@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.