[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/50] Convert remaining single line fprintf() to war
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 40/50] Convert remaining single line fprintf() to warn_report() |
Date: |
Tue, 19 Sep 2017 14:29:29 +0200 |
From: Alistair Francis <address@hidden>
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 lines and chagnes to the test Makefile were manually
updated to allow the code to compile.
Signed-off-by: Alistair Francis <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 2136036..0c64462 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 1534682..b33ede8 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;
--
1.8.3.1
- [Qemu-devel] [PULL 36/50] Convert multi-line fprintf() to warn_report(), (continued)
- [Qemu-devel] [PULL 36/50] Convert multi-line fprintf() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 34/50] Convert remaining error_report() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 42/50] hyperv: add header with protocol definitions, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 37/50] General warn report fixups, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 41/50] i386/cpu/hyperv: support over 64 vcpus for windows guests, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 45/50] target/i386: fix "info mem" for LA57 mode, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 39/50] Makefile: Remove libqemustub.a, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 40/50] Convert remaining single line fprintf() to warn_report(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 44/50] scripts: let checkpatch.pl process an entire GIT branch, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 48/50] osdep.h: Prohibit disabling assert() in supported builds, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 46/50] accel/hax: move hax-stub.c to accel/stubs/, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 50/50] docker: fix creation of archives, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 47/50] checkpatch: add hwaddr to @typeList, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 49/50] default-configs: Replace $(and ...) with $(call land, ...), Paolo Bonzini, 2017/09/19