From: Peter Xu <peterx@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] qemu-error: introduce {error|warn}_report_once
Date: Thu, 24 May 2018 10:56:23 +0800 [thread overview]
Message-ID: <20180524025623.GC756@xz-mi> (raw)
In-Reply-To: <101fcf93-23b4-a628-13cd-8cb2a169fbc4@redhat.com>
On Wed, May 23, 2018 at 10:47:29AM -0500, Eric Blake wrote:
> On 05/21/2018 10:56 PM, Peter Xu wrote:
> > I stole the printk_once() macro.
> >
> > I always wanted to be able to print some error directly if there is a
> > buffer to dump, however we can't use error_report() where the code path
> > can be triggered by DDOS attack. To avoid that, we can introduce a
> > print-once-like function for it. Meanwhile, we also introduce the
> > corresponding helper for warn_report().
> >
> > CC: Markus Armbruster <armbru@redhat.com>
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> > include/qemu/error-report.h | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> >
> > diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
> > index e1c8ae1a52..3e6e84801f 100644
> > --- a/include/qemu/error-report.h
> > +++ b/include/qemu/error-report.h
> > @@ -44,6 +44,32 @@ void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> > void warn_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> > void info_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> > +/* Similar to error_report(), but it only prints the message once. */
> > +#define error_report_once(fmt, ...) \
> > + ({ \
> > + static bool __print_once; \
>
> You're still using the reserved namespace. I asked you to fix that on v1;
> it's disappointing when a later revision doesn't make changes requested by a
> reviewers, without also offering a counter-argument for why the request does
> not need to be considered.
I am sorry. It's totally because I forgot that one! (It rarely
happens since I note them down in most cases, but there must be
something that even interrupted the procedure when I took notes...)
I will repost with another one soon. Sorry again.
--
Peter Xu
next prev parent reply other threads:[~2018-05-24 2:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 3:56 [Qemu-devel] [PATCH v2 0/2] error-report: introduce {error|warn}_report_once Peter Xu
2018-05-22 3:56 ` [Qemu-devel] [PATCH v2 1/2] qemu-error: " Peter Xu
2018-05-23 15:47 ` Eric Blake
2018-05-24 2:56 ` Peter Xu [this message]
2018-05-22 3:56 ` [Qemu-devel] [PATCH v2 2/2] intel-iommu: start to use error_report_once Peter Xu
2018-05-22 21:09 ` Philippe Mathieu-Daudé
2018-05-23 1:19 ` Peter Xu
2018-05-24 3:40 ` Philippe Mathieu-Daudé
2018-05-22 5:08 ` [Qemu-devel] [PATCH v2 0/2] error-report: introduce {error|warn}_report_once Peter Xu
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=20180524025623.GC756@xz-mi \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--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 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.