From nobody Tue Feb 10 02:43:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505826456633850.1483741821326; Tue, 19 Sep 2017 06:07:36 -0700 (PDT) Received: from localhost ([::1]:42745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duIFT-0001kq-9z for importer@patchew.org; Tue, 19 Sep 2017 09:07:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHfc-0004PV-Fr for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duHfU-0005by-Ib for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:28 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:46688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duHfU-0005bk-8M for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:24 -0400 Received: by mail-wm0-x231.google.com with SMTP id i189so4776540wmf.1 for ; Tue, 19 Sep 2017 05:30:24 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id k18sm1292878wmd.22.2017.09.19.05.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 05:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=A+nDuEbAUYSOy+CxeyIAO/0ZTm1m8Osytxr6ffiarVQ=; b=SKl62M33tIe9l1IcApBADhUZRRRaZPV+FGllaZHcCpWv93qoBeL5le7z/DCbffdlZz wMi5rmy1h4aqps4h5nm+2SlfQYwDipNtm0SD/ehhhwiMlNjSmcqPC6mAjBr6t2+UGtPS z48zQJIxH+Xxk1rNHgH83rmg+jJMhV4GcubcOxvO+IOjpJ8wEi3/sPvp60JHajodTp1/ phYDGkAbcUzNH3ab4tYywrECHNgYHl+Bfu41KuyBdVNBbryBD+d8jNXT4rpGPeibqG0t ZI9xGw6v/JTq14hjX2UEK1oWbPIAj8eWunkYv8yShYCHk3j0YD+Y0bVAcDy6xMSlHsqL Tuqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=A+nDuEbAUYSOy+CxeyIAO/0ZTm1m8Osytxr6ffiarVQ=; b=akT+Y1jAmfG5NvqaFVcgSj1/Og8PXmU3TOQKtc7hoonbOvoVOQQCTSssDdH4CyQQG5 EZkB70UZ5zMFvepnop8RxM26xEKHJOe5RRredIgqkUHWDg8PvAT/k8U8AtyikM8RRIV/ 9YGx80JFXMAs+jbxuQsPy62aHO8iBk7ucG92slUorW5wrQY0Nzdtak1UiAUosjHBVnj2 FkDQKjXZYpK7RUZg08CFBBiaz/EO0M9rsjxz5Mtf5bdFWBmmQhZKzGb/CCoI+z8V0hry rVxz4hPj1IcWIP3BGFoGQWoKvZpJzG95Wrkb+h28/cTvE59FeA/rV5DUuaEZ1Y7gPapz NMug== X-Gm-Message-State: AHPjjUi/2f7O80n6ETH4KdO5JWcjWQ1VkqFjIUy4AgHoy15ignwfSXfG 6VHFcQ/QKbQlyjlbZ/m+O2A7Ryed X-Google-Smtp-Source: AOwi7QBaDvtl1cSS8nYkIuGFtyOyOL0WB3p6CjKxAow3Loo29nzD+LpPL+cP0gCyT+mph4RvPQ5mxw== X-Received: by 10.28.111.71 with SMTP id k68mr996204wmc.64.1505824222849; Tue, 19 Sep 2017 05:30:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 14:29:24 +0200 Message-Id: <1505824179-21541-36-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> References: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [PULL 35/50] Convert single line fprintf(.../n) to warn_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , James Hogan , Eduardo Habkost , "Michael S. Tsirkin" , Jason Wang , Michael Roth , Max Reitz , Gerd Hoffmann , Stefan Hajnoczi , Yongbok Kim , Igor Mammedov , Alistair Francis , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis 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 --- block/vvfat.c | 4 +++- hw/acpi/core.c | 3 ++- hw/i386/pc.c | 2 +- hw/misc/applesmc.c | 2 +- hw/usb/hcd-ehci.c | 5 +++-- hw/virtio/virtio-balloon.c | 3 ++- net/hub.c | 3 ++- qga/vss-win32.c | 3 ++- target/mips/kvm.c | 4 ++-- trace/simple.c | 3 ++- ui/keymaps.c | 2 +- ui/spice-display.c | 2 +- 12 files changed, 22 insertions(+), 14 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index c54fa94..efad575 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -32,6 +32,7 @@ #include "qapi/qmp/qbool.h" #include "qapi/qmp/qstring.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" =20 #ifndef S_IWGRP #define S_IWGRP 0 @@ -3028,7 +3029,8 @@ DLOG(checkpoint()); if (memcmp(direntries + k, array_get(&(s->directory), dir_index += k), sizeof(direntry_t))) { - fprintf(stderr, "Warning: tried to write to wr= ite-protected file\n"); + warn_report("tried to write to write-protected= " + "file"); return -1; } } diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 95fcac9..2a1b79c 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -28,6 +28,7 @@ #include "qapi/opts-visitor.h" #include "qapi-visit.h" #include "qapi-event.h" +#include "qemu/error-report.h" =20 struct acpi_table_header { uint16_t _length; /* our length, not actual part of the hdr */ @@ -221,7 +222,7 @@ static void acpi_table_install(const char unsigned *blo= b, size_t bloblen, } =20 if (!has_header && changed_fields =3D=3D 0) { - fprintf(stderr, "warning: ACPI table: no headers are specified\n"); + warn_report("ACPI table: no headers are specified"); } =20 /* recalculate checksum */ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c882f8c..ef5f30e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1310,7 +1310,7 @@ void pc_acpi_init(const char *default_dsdt) =20 filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, default_dsdt); if (filename =3D=3D NULL) { - fprintf(stderr, "WARNING: failed to find %s\n", default_dsdt); + warn_report("failed to find %s", default_dsdt); } else { QemuOpts *opts =3D qemu_opts_create(qemu_find_opts("acpi"), NULL, = 0, &error_abort); diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 7896812..7be8b5f 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -331,7 +331,7 @@ static void applesmc_isa_realize(DeviceState *dev, Erro= r **errp) s->iobase + APPLESMC_ERR_PORT); =20 if (!s->osk || (strlen(s->osk) !=3D 64)) { - fprintf(stderr, "WARNING: Using AppleSMC with invalid key\n"); + warn_report("Using AppleSMC with invalid key"); s->osk =3D default_osk; } =20 diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 604912c..46fd30b 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -32,6 +32,7 @@ #include "hw/usb/ehci-regs.h" #include "hw/usb/hcd-ehci.h" #include "trace.h" +#include "qemu/error-report.h" =20 #define FRAME_TIMER_FREQ 1000 #define FRAME_TIMER_NS (NANOSECONDS_PER_SECOND / FRAME_TIMER_FREQ) @@ -348,7 +349,7 @@ static void ehci_trace_sitd(EHCIState *s, hwaddr addr, static void ehci_trace_guest_bug(EHCIState *s, const char *message) { trace_usb_ehci_guest_bug(message); - fprintf(stderr, "ehci warning: %s\n", message); + warn_report("%s", message); } =20 static inline bool ehci_enabled(EHCIState *s) @@ -1728,7 +1729,7 @@ static int ehci_state_fetchsitd(EHCIState *ehci, int = async) /* siTD is not active, nothing to do */; } else { /* TODO: split transfers are not implemented */ - fprintf(stderr, "WARNING: Skipping active siTD\n"); + warn_report("Skipping active siTD"); } =20 ehci_set_fetch_addr(ehci, async, sitd.next); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a705e0e..37cde38 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -26,6 +26,7 @@ #include "qapi/visitor.h" #include "qapi-event.h" #include "trace.h" +#include "qemu/error-report.h" =20 #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" @@ -292,7 +293,7 @@ static void virtio_balloon_receive_stats(VirtIODevice *= vdev, VirtQueue *vq) s->stats_vq_offset =3D offset; =20 if (qemu_gettimeofday(&tv) < 0) { - fprintf(stderr, "warning: %s: failed to get time of day\n", __func= __); + warn_report("%s: failed to get time of day", __func__); goto out; } =20 diff --git a/net/hub.c b/net/hub.c index 32d8cf5..afe941a 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" =20 /* * A hub broadcasts incoming packets to all its ports except the source po= rt. @@ -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, diff --git a/qga/vss-win32.c b/qga/vss-win32.c index a80933c..dcb2756 100644 --- a/qga/vss-win32.c +++ b/qga/vss-win32.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include +#include "qemu/error-report.h" #include "qga/guest-agent-core.h" #include "qga/vss-win32.h" #include "qga/vss-win32/requester.h" @@ -61,7 +62,7 @@ static bool vss_check_os_version(void) return false; } if (wow64) { - fprintf(stderr, "Warning: Running under WOW64\n"); + warn_report("Running under WOW64"); } #endif return !wow64; diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 3317905..a23aa43 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -95,11 +95,11 @@ void kvm_mips_reset_vcpu(MIPSCPU *cpu) CPUMIPSState *env =3D &cpu->env; =20 if (!kvm_mips_fpu_cap && env->CP0_Config1 & (1 << CP0C1_FP)) { - fprintf(stderr, "Warning: KVM does not support FPU, disabling\n"); + warn_report("KVM does not support FPU, disabling"); env->CP0_Config1 &=3D ~(1 << CP0C1_FP); } if (!kvm_mips_msa_cap && env->CP0_Config3 & (1 << CP0C3_MSAP)) { - fprintf(stderr, "Warning: KVM does not support MSA, disabling\n"); + warn_report("KVM does not support MSA, disabling"); env->CP0_Config3 &=3D ~(1 << CP0C3_MSAP); } =20 diff --git a/trace/simple.c b/trace/simple.c index a221a3f..e82018d 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -15,6 +15,7 @@ #include "qemu/timer.h" #include "trace/control.h" #include "trace/simple.h" +#include "qemu/error-report.h" =20 /** Trace file header event ID, picked to avoid conflict with real event I= Ds */ #define HEADER_EVENT_ID (~(uint64_t)0) @@ -405,7 +406,7 @@ bool st_init(void) =20 thread =3D trace_thread_create(writeout_thread); if (!thread) { - fprintf(stderr, "warning: unable to initialize simple trace backen= d\n"); + warn_report("unable to initialize simple trace backend"); return false; } =20 diff --git a/ui/keymaps.c b/ui/keymaps.c index fa00b82..7fa21f8 100644 --- a/ui/keymaps.c +++ b/ui/keymaps.c @@ -141,7 +141,7 @@ static kbd_layout_t *parse_keyboard_layout(const name2k= eysym_t *table, int keysym; keysym =3D get_keysym(table, keyname); if (keysym =3D=3D 0) { - /* fprintf(stderr, "Warning: unknown keysym %s\n", lin= e);*/ + /* warn_report("unknown keysym %s", line);*/ } else { const char *rest =3D line + offset + 1; int keycode =3D strtol(rest, NULL, 0); diff --git a/ui/spice-display.c b/ui/spice-display.c index 042292c..0963c78 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -850,7 +850,7 @@ static void qemu_spice_gl_unblock_bh(void *opaque) =20 static void qemu_spice_gl_block_timer(void *opaque) { - fprintf(stderr, "WARNING: spice: no gl-draw-done within one second\n"); + warn_report("spice: no gl-draw-done within one second"); } =20 static void spice_gl_refresh(DisplayChangeListener *dcl) --=20 1.8.3.1