From 2ab4b135638ab595fa534d46d8358125d2ae1f6a Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Mon, 11 Sep 2017 12:52:50 -0700 Subject: Convert single line fprintf(.../n) to warn_report() Convert all the single line uses of fprintf(stderr, "warning:"..."\n"... 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[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \ {} + Some of the lines were manually edited to reduce the line length to below 80 charecters. The #include lines were manually updated to allow the code to compile. Signed-off-by: Alistair Francis Cc: Kevin Wolf Cc: Max Reitz Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Gerd Hoffmann Cc: Jason Wang Cc: Michael Roth Cc: James Hogan Cc: Aurelien Jarno Cc: Yongbok Kim Cc: Stefan Hajnoczi Reviewed-by: Markus Armbruster Reviewed-by: James Hogan [mips] Message-Id: Signed-off-by: Paolo Bonzini --- net/hub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/hub.c b/net/hub.c index 32d8cf5cd4..afe941ae7a 100644 --- a/net/hub.c +++ b/net/hub.c @@ -18,6 +18,7 @@ #include "clients.h" #include "hub.h" #include "qemu/iov.h" +#include "qemu/error-report.h" /* * A hub broadcasts incoming packets to all its ports except the source port. @@ -330,7 +331,7 @@ void net_hub_check_clients(void) } } if (has_host_dev && !has_nic) { - fprintf(stderr, "Warning: vlan %d with no nics\n", hub->id); + warn_report("vlan %d with no nics", hub->id); } if (has_nic && !has_host_dev) { fprintf(stderr, -- cgit v1.2.3-55-g7522