[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" wi
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Thu, 19 Oct 2017 19:53:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 19.10.2017 18:18, Alistair Francis wrote:
> Replace a large number of the fprintf(stderr, "*\n" calls with
> error_report(). The functions were renamed with these commands and then
> compiler issues where manually fixed.
[...]
> diff --git a/util/aio-posix.c b/util/aio-posix.c
> index 5946ac09f0..29fff51fcf 100644
> --- a/util/aio-posix.c
> +++ b/util/aio-posix.c
> @@ -15,6 +15,7 @@
>
> #include "qemu/osdep.h"
> #include "qemu-common.h"
> +#include "qemu/error-report.h"
> #include "block/block.h"
> #include "qemu/rcu_queue.h"
> #include "qemu/sockets.h"
> @@ -703,8 +704,8 @@ void aio_context_setup(AioContext *ctx)
> {
> /* TODO remove this in final patch submission */
> if (getenv("QEMU_AIO_POLL_MAX_NS")) {
> - fprintf(stderr, "The QEMU_AIO_POLL_MAX_NS environment variable has "
> - "been replaced with -object iothread,poll-max-ns=NUM\n");
> + error_report("The QEMU_AIO_POLL_MAX_NS environment variable has "
> + "been replaced with -object iothread,poll-max-ns=NUM");
> exit(1);
> }
The comment in front of this code block indicates that this should
rather be removed completely. Stefan, do you agree?
> diff --git a/util/error.c b/util/error.c
> index 3efdd69162..e423368ca0 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -32,7 +32,7 @@ Error *error_fatal;
> static void error_handle_fatal(Error **errp, Error *err)
> {
> if (errp == &error_abort) {
> - fprintf(stderr, "Unexpected error in %s() at %s:%d:\n",
> + error_report("Unexpected error in %s() at %s:%d:",
> err->func, err->src, err->line);
Indentation is still wrong if the statement spans more than one line :-(
Thomas
- [Qemu-devel] [PATCH v3 34/46] hw/sd: Replace fprintf(stderr, "*\n" with error_report(), (continued)
- [Qemu-devel] [PATCH v3 34/46] hw/sd: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 35/46] hw/sh4: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 37/46] hw/ssi: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 36/46] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 38/46] hw/timer: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 40/46] hw/watchdog: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 41/46] hw/xen*: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 43/46] ui: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 39/46] hw/usb: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(),
Thomas Huth <=
- Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(), Stefan Weil, 2017/10/19
- Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(), Thomas Huth, 2017/10/20
- Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(), Stefan Hajnoczi, 2017/10/20
- Re: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/20
[Qemu-devel] [PATCH v3 45/46] target: Use qemu_log() instead of fprintf(stderr, ...), Alistair Francis, 2017/10/19
[Qemu-devel] [PATCH v3 44/46] tcg: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
[Qemu-devel] [PATCH v3 46/46] target: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19