[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 13/14] tcg: Replace fprintf(stderr, "*\n" with er
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v8 13/14] tcg: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Sat, 3 Feb 2018 09:43:14 +0100 |
From: Alistair Francis <address@hidden>
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.
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'
\
{} +
find ./* -type f -exec sed -i \
'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
Signed-off-by: Alistair Francis <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: Richard Henderson <address@hidden>
Cc: Stefan Weil <address@hidden>
Conversions that aren't followed by exit() dropped, because they might
be inappropriate.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
cpus.c | 10 +++++-----
exec.c | 6 +++---
vl.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/cpus.c b/cpus.c
index 2cb0af9b22..5d3a165960 100644
--- a/cpus.c
+++ b/cpus.c
@@ -259,7 +259,7 @@ int64_t cpu_get_icount_raw(void)
if (cpu && cpu->running) {
if (!cpu->can_do_io) {
- fprintf(stderr, "Bad icount read\n");
+ error_report("Bad icount read");
exit(1);
}
/* Take into account what has run */
@@ -1181,7 +1181,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
r = kvm_init_vcpu(cpu);
if (r < 0) {
- fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
+ error_report("kvm_init_vcpu failed: %s", strerror(-r));
exit(1);
}
@@ -1211,7 +1211,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
static void *qemu_dummy_cpu_thread_fn(void *arg)
{
#ifdef _WIN32
- fprintf(stderr, "qtest is not supported under Windows\n");
+ error_report("qtest is not supported under Windows");
exit(1);
#else
CPUState *cpu = arg;
@@ -1631,8 +1631,8 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
#else /* _WIN32 */
if (!qemu_cpu_is_self(cpu)) {
if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) {
- fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n",
- __func__, GetLastError());
+ error_report("%s: QueueUserAPC failed with error %lu", __func__,
+ GetLastError());
exit(1);
}
}
diff --git a/exec.c b/exec.c
index 629a508385..e8d7b335b6 100644
--- a/exec.c
+++ b/exec.c
@@ -2216,9 +2216,9 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
flags, -1, 0);
}
if (area != vaddr) {
- fprintf(stderr, "Could not remap addr: "
- RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n",
- length, addr);
+ error_report("Could not remap addr: "
+ RAM_ADDR_FMT "@" RAM_ADDR_FMT "",
+ length, addr);
exit(1);
}
memory_try_enable_merging(vaddr, length);
diff --git a/vl.c b/vl.c
index e517a8d995..32db91da1e 100644
--- a/vl.c
+++ b/vl.c
@@ -2172,7 +2172,7 @@ static DisplayType select_display(const char *p)
display_opengl = 1;
display = DT_EGL;
#else
- fprintf(stderr, "egl support is disabled\n");
+ error_report("egl support is disabled");
exit(1);
#endif
} else if (strstart(p, "curses", &opts)) {
--
2.13.6
- [Qemu-devel] [PATCH v8 00/14] Remove some of the fprintf(stderr, "*, Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 07/14] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 03/14] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 10/14] hw/sd: Replace fprintf(stderr, "*\n" with DPRINTF(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 04/14] hw/lm32: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 06/14] hw/moxie: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 13/14] tcg: Replace fprintf(stderr, "*\n" with error_report(),
Markus Armbruster <=
- [Qemu-devel] [PATCH v8 05/14] hw/mips: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 12/14] hw/xen*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 09/14] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 08/14] hw/pci*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 02/14] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 11/14] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/03
- [Qemu-devel] [PATCH v8 14/14] target: Use qemu_log() instead of fprintf(stderr, ...), Markus Armbruster, 2018/02/03