[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 40/46] hw/watchdog: Replace fprintf(stderr, "*\n"
From: |
Alistair Francis |
Subject: |
[Qemu-devel] [PATCH v3 40/46] hw/watchdog: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Thu, 19 Oct 2017 09:18:11 -0700 |
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}' \
{} +
Some lines where then manually tweaked to pass checkpatch.
Signed-off-by: Alistair Francis <address@hidden>
---
V2:
- Split hw patch into individual directories
hw/watchdog/watchdog.c | 9 +++++----
hw/watchdog/wdt_i6300esb.c | 8 +++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 670114ecfe..d6d11ef1e5 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -20,6 +20,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu/queue.h"
@@ -52,7 +53,7 @@ int select_watchdog(const char *p)
/* -watchdog ? lists available devices and exits cleanly. */
if (is_help_option(p)) {
QLIST_FOREACH(model, &watchdog_list, entry) {
- fprintf(stderr, "\t%s\t%s\n",
+ error_report("\t%s\t%s",
model->wdt_name, model->wdt_description);
}
return 2;
@@ -68,9 +69,9 @@ int select_watchdog(const char *p)
}
}
- fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n");
+ error_report("Unknown -watchdog device. Supported devices are:");
QLIST_FOREACH(model, &watchdog_list, entry) {
- fprintf(stderr, "\t%s\t%s\n",
+ error_report("\t%s\t%s",
model->wdt_name, model->wdt_description);
}
return 1;
@@ -126,7 +127,7 @@ void watchdog_perform_action(void)
case WATCHDOG_ACTION_DEBUG:
qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG, &error_abort);
- fprintf(stderr, "watchdog: timer fired\n");
+ error_report("watchdog: timer fired");
break;
case WATCHDOG_ACTION_NONE:
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index e596b0804d..c5f5190e55 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -20,7 +20,7 @@
*/
#include "qemu/osdep.h"
-
+#include "qemu/error-report.h"
#include "qemu-common.h"
#include "qemu/timer.h"
#include "sysemu/watchdog.h"
@@ -186,10 +186,12 @@ static void i6300esb_timer_expired(void *vp)
/* What to do at the end of stage 1? */
switch (d->int_type) {
case INT_TYPE_IRQ:
- fprintf(stderr, "i6300esb_timer_expired: I would send APIC 1 INT
10 here if I knew how (XXX)\n");
+ error_report("i6300esb_timer_expired: I would send APIC 1 INT 10"
+ "here if I knew how (XXX)");
break;
case INT_TYPE_SMI:
- fprintf(stderr, "i6300esb_timer_expired: I would send SMI here if
I knew how (XXX)\n");
+ error_report("i6300esb_timer_expired: I would send SMI here if I"
+ "knew how (XXX)");
break;
}
--
2.11.0
- [Qemu-devel] [PATCH v3 29/46] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), (continued)
- [Qemu-devel] [PATCH v3 29/46] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 31/46] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 33/46] hw/scsi: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [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 <=
- [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