All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Eric Blake <eblake@redhat.com>,  Cleber Rosa <crosa@redhat.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	Xie Yongji <xieyongji@bytedance.com>,
	 Kyle Evans <kevans@freebsd.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	 John Snow <jsnow@redhat.com>,
	Michael Roth <michael.roth@amd.com>,
	Kevin Wolf <kwolf@redhat.com>,
	 "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Laurent Vivier <laurent@vivier.eu>,  Fam Zheng <fam@euphon.net>,
	Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH v2 04/15] error-report: introduce overridable error_is_detailed()
Date: Tue, 12 Jul 2022 09:02:13 -0600	[thread overview]
Message-ID: <CANCZdfoVqU-J53SCy+4Lfy-yjMw3B39WF+gdu48tZSL0Ev+Lgw@mail.gmail.com> (raw)
In-Reply-To: <20220712093528.4144184-5-marcandre.lureau@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3043 bytes --]

On Tue, Jul 12, 2022 at 3:36 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Remove the direct dependency from error-report to monitor code.
> This will allow to move error-report to a subproject.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/error-report.h | 2 ++
>  softmmu/vl.c                | 5 +++++
>  stubs/error-is-detailed.c   | 7 +++++++
>  util/error-report.c         | 3 +--
>  stubs/meson.build           | 1 +
>  5 files changed, 16 insertions(+), 2 deletions(-)
>  create mode 100644 stubs/error-is-detailed.c
>

Reviewed-by: Warner Losh <imp@bsdimp.com>


> diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
> index 3ae2357fda54..6ab25d458350 100644
> --- a/include/qemu/error-report.h
> +++ b/include/qemu/error-report.h
> @@ -30,6 +30,8 @@ void loc_set_none(void);
>  void loc_set_cmdline(char **argv, int idx, int cnt);
>  void loc_set_file(const char *fname, int lno);
>
> +bool error_is_detailed(void);
> +
>  int error_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
>  int error_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
>
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 3f264d4b0930..f94efc56e9d6 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -2589,6 +2589,11 @@ void qmp_x_exit_preconfig(Error **errp)
>      }
>  }
>
> +bool error_is_detailed(void)
> +{
> +    return !monitor_cur();
> +}
> +
>  void qemu_init(int argc, char **argv, char **envp)
>  {
>      QemuOpts *opts;
> diff --git a/stubs/error-is-detailed.c b/stubs/error-is-detailed.c
> new file mode 100644
> index 000000000000..c47cd236932f
> --- /dev/null
> +++ b/stubs/error-is-detailed.c
> @@ -0,0 +1,7 @@
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +
> +bool error_is_detailed(void)
> +{
> +    return TRUE;
> +}
> diff --git a/util/error-report.c b/util/error-report.c
> index c43227a975e2..4d1d66fc0650 100644
> --- a/util/error-report.c
> +++ b/util/error-report.c
> @@ -11,7 +11,6 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include "monitor/monitor.h"
>  #include "qemu/error-report.h"
>
>  /*
> @@ -195,7 +194,7 @@ real_time_iso8601(void)
>   */
>  static void vreport(report_type type, const char *fmt, va_list ap)
>  {
> -    bool detailed = !monitor_cur();
> +    bool detailed = error_is_detailed();
>      gchar *timestr;
>
>      if (message_with_timestamp && detailed) {
> diff --git a/stubs/meson.build b/stubs/meson.build
> index d8f3fd5c44f2..0f3a782824f9 100644
> --- a/stubs/meson.build
> +++ b/stubs/meson.build
> @@ -9,6 +9,7 @@ stub_ss.add(files('cpus-get-virtual-clock.c'))
>  stub_ss.add(files('qemu-timer-notify-cb.c'))
>  stub_ss.add(files('icount.c'))
>  stub_ss.add(files('dump.c'))
> +stub_ss.add(files('error-is-detailed.c'))
>  stub_ss.add(files('error-printf.c'))
>  stub_ss.add(files('fdset.c'))
>  stub_ss.add(files('gdbstub.c'))
> --
> 2.37.0.rc0
>
>

[-- Attachment #2: Type: text/html, Size: 4082 bytes --]

  reply	other threads:[~2022-07-12 15:07 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  9:35 [PATCH v2 00/15] Preliminary patches for subproject split marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 01/15] error-report: misc comment fix marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 02/15] error-report: introduce "detailed" variable marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 03/15] error-report: simplify print_loc() marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 04/15] error-report: introduce overridable error_is_detailed() marcandre.lureau
2022-07-12 15:02   ` Warner Losh [this message]
2022-07-19  7:24   ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 05/15] stubs: remove needless error_vprintf_unless_qmp() marcandre.lureau
2022-07-19  7:24   ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 06/15] qapi: move QEMU-specific dispatch code in monitor marcandre.lureau
2022-08-02 10:58   ` Markus Armbruster
2022-08-02 11:19     ` Marc-André Lureau
2022-08-02 12:21       ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 07/15] scripts/qapi-gen: add -i option marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 08/15] scripts/qapi: add required system includes to visitor marcandre.lureau
2022-07-12 15:08   ` Warner Losh
2022-07-12  9:35 ` [PATCH v2 09/15] util: move 256-by-128 division helpers to int128 marcandre.lureau
2022-08-04 16:17   ` Marc-André Lureau
2022-08-04 17:04   ` Lucas Mateus Martins Araujo e Castro
2022-07-12  9:35 ` [PATCH v2 10/15] qemu-common: introduce a common subproject marcandre.lureau
2022-07-12 14:57   ` Warner Losh
2022-07-15 11:55     ` Marc-André Lureau
2022-07-12  9:35 ` [PATCH v2 11/15] qemu-common: move scripts/qapi marcandre.lureau
2022-08-05  8:02   ` Markus Armbruster
2022-08-05  8:49     ` Marc-André Lureau
2022-08-11  6:52       ` Markus Armbruster
2022-08-11  7:11         ` Marc-André Lureau
2022-08-11  9:05           ` Markus Armbruster
2022-08-11 10:09             ` Marc-André Lureau
2022-08-11 10:22               ` Peter Maydell
2022-08-11 10:50                 ` Marc-André Lureau
2022-08-11 12:15                   ` Daniel P. Berrangé
2022-08-11 13:35                     ` Markus Armbruster
2022-08-22  8:16                       ` Marc-André Lureau
2022-09-02 11:15                         ` Markus Armbruster
2022-09-02 13:22                           ` Marc-André Lureau
2022-08-11 11:46                 ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 12/15] qemu-common: move glib-compat.h marcandre.lureau
2022-07-12 15:00   ` Warner Losh
2022-07-12  9:35 ` [PATCH v2 13/15] qemu-common: move error-report marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT" marcandre.lureau
2022-08-05 10:35   ` Paolo Bonzini
2022-08-05 11:22     ` Marc-André Lureau
2022-07-12  9:35 ` [PATCH v2 15/15] qemu-common: add error-report test marcandre.lureau

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=CANCZdfoVqU-J53SCy+4Lfy-yjMw3B39WF+gdu48tZSL0Ev+Lgw@mail.gmail.com \
    --to=imp@bsdimp.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kevans@freebsd.org \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    --cc=xieyongji@bytedance.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.