[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 8/8] Convert remaining single line fprintf() to w
From: |
Alistair Francis |
Subject: |
[Qemu-devel] [PATCH v4 8/8] Convert remaining single line fprintf() to warn_report() |
Date: |
Mon, 11 Sep 2017 12:53:05 -0700 |
Convert any remaining uses of fprintf(stderr, "warning:"...
to use warn_report() instead. This helps standardise on a single
method of printing warnings to the user.
All of the warnings were changed using this command:
find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig'
{} +
The #include line and the change to the test Makefile were manually
updated to allow the code to compile.
Signed-off-by: Alistair Francis <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
This pattern matches any case of fprintf(stderr, "warning:"... and is
the most open pattern match in the series.
tests/Makefile.include | 2 +-
util/cutils.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3d6726e95c..2647aaaa65 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -593,7 +593,7 @@ tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y)
$(test-crypto-obj-y)
tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o
migration/page_cache.o $(test-util-obj-y)
-tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
+tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
$(test-util-obj-y)
tests/test-int128$(EXESUF): tests/test-int128.o
tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
diff --git a/util/cutils.c b/util/cutils.c
index 1534682083..b33ede83d1 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -30,6 +30,7 @@
#include "qemu/iov.h"
#include "net/net.h"
#include "qemu/cutils.h"
+#include "qemu/error-report.h"
void strpadcpy(char *buf, int buf_size, const char *str, char pad)
{
@@ -601,7 +602,7 @@ int parse_debug_env(const char *name, int max, int initial)
return initial;
}
if (debug < 0 || debug > max || errno != 0) {
- fprintf(stderr, "warning: %s not in [0, %d]", name, max);
+ warn_report("%s not in [0, %d]", name, max);
return initial;
}
return debug;
--
2.11.0
- [Qemu-devel] [PATCH v4 0/8] More warning reporting fixed, Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 1/8] hw/i386: Improve some of the warning messages, Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 2/8] Convert remaining error_report() to warn_report(), Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 3/8] Convert single line fprintf(.../n) to warn_report(), Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 5/8] General warn report fixups, Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 6/8] target/mips: Convert VM clock update prints to warn_report, Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 4/8] Convert multi-line fprintf() to warn_report(), Alistair Francis, 2017/09/11
- [Qemu-devel] [PATCH v4 8/8] Convert remaining single line fprintf() to warn_report(),
Alistair Francis <=
- [Qemu-devel] [PATCH v4 7/8] Makefile: Remove libqemustub.a, Alistair Francis, 2017/09/11
- Re: [Qemu-devel] [PATCH v4 0/8] More warning reporting fixed, no-reply, 2017/09/11
- Re: [Qemu-devel] [PATCH v4 0/8] More warning reporting fixed, Paolo Bonzini, 2017/09/12
- Re: [Qemu-devel] [PATCH v4 0/8] More warning reporting fixed, Paolo Bonzini, 2017/09/12