From nobody Sat Nov 8 06:03:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549979445582719.0718648698003; Tue, 12 Feb 2019 05:50:45 -0800 (PST) Received: from localhost ([127.0.0.1]:39787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYSN-0003IC-G9 for importer@patchew.org; Tue, 12 Feb 2019 08:50:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYQM-0002A4-OH for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtYQK-0006Qy-H5 for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30862) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtYQH-0006BQ-V7; Tue, 12 Feb 2019 08:48:31 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E80690916; Tue, 12 Feb 2019 13:48:19 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-116-178.ams2.redhat.com [10.36.116.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 309BC2C168; Tue, 12 Feb 2019 13:48:13 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com, mst@redhat.com Date: Tue, 12 Feb 2019 13:47:55 +0000 Message-Id: <20190212134758.10514-2-dgilbert@redhat.com> In-Reply-To: <20190212134758.10514-1-dgilbert@redhat.com> References: <20190212134758.10514-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 12 Feb 2019 13:48:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] pckbd: Convert DPRINTF->trace 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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- hw/input/pckbd.c | 19 ++++++------------- hw/input/trace-events | 7 +++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 72e7d5f6cc..47a606f5e3 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -30,14 +30,7 @@ #include "hw/input/i8042.h" #include "sysemu/sysemu.h" =20 -/* debug PC keyboard */ -//#define DEBUG_KBD -#ifdef DEBUG_KBD -#define DPRINTF(fmt, ...) \ - do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) -#endif +#include "trace.h" =20 /* Keyboard Controller Commands */ #define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */ @@ -210,7 +203,7 @@ static uint64_t kbd_read_status(void *opaque, hwaddr ad= dr, KBDState *s =3D opaque; int val; val =3D s->status; - DPRINTF("kbd: read status=3D0x%02x\n", val); + trace_pckbd_kbd_read_status(val); return val; } =20 @@ -224,7 +217,7 @@ static void kbd_queue(KBDState *s, int b, int aux) =20 static void outport_write(KBDState *s, uint32_t val) { - DPRINTF("kbd: write outport=3D0x%02x\n", val); + trace_pckbd_outport_write(val); s->outport =3D val; qemu_set_irq(s->a20_out, (val >> 1) & 1); if (!(val & 1)) { @@ -237,7 +230,7 @@ static void kbd_write_command(void *opaque, hwaddr addr, { KBDState *s =3D opaque; =20 - DPRINTF("kbd: write cmd=3D0x%02" PRIx64 "\n", val); + trace_pckbd_kbd_write_command(val); =20 /* Bits 3-0 of the output port P2 of the keyboard controller may be pu= lsed * low for approximately 6 micro seconds. Bits 3-0 of the KBD_CCMD_PUL= SE @@ -326,7 +319,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr, else val =3D ps2_read_data(s->kbd); =20 - DPRINTF("kbd: read data=3D0x%02x\n", val); + trace_pckbd_kbd_read_data(val); return val; } =20 @@ -335,7 +328,7 @@ static void kbd_write_data(void *opaque, hwaddr addr, { KBDState *s =3D opaque; =20 - DPRINTF("kbd: write data=3D0x%02" PRIx64 "\n", val); + trace_pckbd_kbd_write_data(val); =20 switch(s->write_cmd) { case 0: diff --git a/hw/input/trace-events b/hw/input/trace-events index 3965a842ae..8e53ae5bbf 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -14,6 +14,13 @@ adb_mouse_readreg(int reg, uint8_t val0, uint8_t val1) "= reg %d obuf[0] 0x%2.2x o adb_mouse_request_change_addr(int devaddr) "change addr to 0x%x" adb_mouse_request_change_addr_and_handler(int devaddr, int handler) "chang= e addr and handler to 0x%x, 0x%x" =20 +# hw/input/pckbd.c +pckbd_kbd_read_data(uint32_t val) "0x%02x" +pckbd_kbd_read_status(int status) "0x%02x" +pckbd_outport_write(uint32_t val) "0x%02x" +pckbd_kbd_write_command(uint64_t val) "0x%02"PRIx64 +pckbd_kbd_write_data(uint64_t val) "0x%02"PRIx64 + # hw/input/ps2.c ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x" ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifie= r, unsigned int modifiers) "%p qcode %d down %d modifier 0x%x modifiers 0x%= x" --=20 2.20.1 From nobody Sat Nov 8 06:03:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549979585612649.4540205042905; Tue, 12 Feb 2019 05:53:05 -0800 (PST) Received: from localhost ([127.0.0.1]:39839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYUe-0005Il-Kz for importer@patchew.org; Tue, 12 Feb 2019 08:53:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYQg-0002Ks-Cy for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtYQf-00076i-MC for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36166) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtYQf-0006sy-GD; Tue, 12 Feb 2019 08:48:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2682240220; Tue, 12 Feb 2019 13:48:49 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-116-178.ams2.redhat.com [10.36.116.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0A21649C5; Tue, 12 Feb 2019 13:48:19 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com, mst@redhat.com Date: Tue, 12 Feb 2019 13:47:56 +0000 Message-Id: <20190212134758.10514-3-dgilbert@redhat.com> In-Reply-To: <20190212134758.10514-1-dgilbert@redhat.com> References: <20190212134758.10514-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 12 Feb 2019 13:48:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] HMP: Prepend errors with 'Error:' 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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Always make error messages start with 'Error:' as a fallback to make sure that anything parsing them can tell it failed. Note: Some places don't use hmp_handle_error Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index b2a2b1f84e..4d14718fea 100644 --- a/hmp.c +++ b/hmp.c @@ -62,7 +62,7 @@ static void hmp_handle_error(Monitor *mon, Error **errp) { assert(errp); if (*errp) { - error_report_err(*errp); + error_reportf_err(*errp, "Error: "); } } =20 --=20 2.20.1 From nobody Sat Nov 8 06:03:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549979466607519.5364532866947; Tue, 12 Feb 2019 05:51:06 -0800 (PST) Received: from localhost ([127.0.0.1]:39817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYSi-0003co-9h for importer@patchew.org; Tue, 12 Feb 2019 08:51:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYQg-0002Ku-DI for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtYQf-00076I-He for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtYQf-00071l-Ba; Tue, 12 Feb 2019 08:48:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A2DE7F36F; Tue, 12 Feb 2019 13:48:51 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-116-178.ams2.redhat.com [10.36.116.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D85683BAE; Tue, 12 Feb 2019 13:48:49 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com, mst@redhat.com Date: Tue, 12 Feb 2019 13:47:57 +0000 Message-Id: <20190212134758.10514-4-dgilbert@redhat.com> In-Reply-To: <20190212134758.10514-1-dgilbert@redhat.com> References: <20190212134758.10514-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 12 Feb 2019 13:48:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] kvm: Add kvm_set_ioeventfd* traces 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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add a couple of traces around the kvm_set_ioeventfd* calls. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- accel/kvm/kvm-all.c | 3 +++ accel/kvm/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4e1de942ce..fd92b6f375 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -657,6 +657,8 @@ static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, = uint32_t val, .fd =3D fd, }; =20 + trace_kvm_set_ioeventfd_mmio(fd, (uint64_t)addr, val, assign, size, + datamatch); if (!kvm_enabled()) { return -ENOSYS; } @@ -688,6 +690,7 @@ static int kvm_set_ioeventfd_pio(int fd, uint16_t addr,= uint16_t val, .fd =3D fd, }; int r; + trace_kvm_set_ioeventfd_pio(fd, addr, val, assign, size, datamatch); if (!kvm_enabled()) { return -ENOSYS; } diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events index 58e98efe5d..8841025d68 100644 --- a/accel/kvm/trace-events +++ b/accel/kvm/trace-events @@ -12,5 +12,7 @@ kvm_irqchip_commit_routes(void) "" kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector= %d virq %d" kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=3D%d" kvm_irqchip_release_virq(int virq) "virq %d" +kvm_set_ioeventfd_mmio(int fd, uint64_t addr, uint32_t val, bool assign, u= int32_t size, bool datamatch) "fd: %d @0x%" PRIx64 " val=3D0x%x assign: %d = size: %d match: %d" +kvm_set_ioeventfd_pio(int fd, uint16_t addr, uint32_t val, bool assign, ui= nt32_t size, bool datamatch) "fd: %d @0x%x val=3D0x%x assign: %d size: %d m= atch: %d" kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_add= r, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags= =3D0x%x gpa=3D0x%"PRIx64 " size=3D0x%"PRIx64 " ua=3D0x%"PRIx64 " ret=3D%d" =20 --=20 2.20.1 From nobody Sat Nov 8 06:03:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549979612699892.6732927898623; Tue, 12 Feb 2019 05:53:32 -0800 (PST) Received: from localhost ([127.0.0.1]:39841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYV7-0005cA-NU for importer@patchew.org; Tue, 12 Feb 2019 08:53:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtYQi-0002M8-3K for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtYQg-0007Db-VJ for qemu-devel@nongnu.org; Tue, 12 Feb 2019 08:48:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35276) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtYQg-00078V-Ks; Tue, 12 Feb 2019 08:48:54 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD25889C51; Tue, 12 Feb 2019 13:48:53 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-116-178.ams2.redhat.com [10.36.116.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E40F8490B; Tue, 12 Feb 2019 13:48:50 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com, mst@redhat.com Date: Tue, 12 Feb 2019 13:47:58 +0000 Message-Id: <20190212134758.10514-5-dgilbert@redhat.com> In-Reply-To: <20190212134758.10514-1-dgilbert@redhat.com> References: <20190212134758.10514-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 12 Feb 2019 13:48:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] wavcapture: Convert to error_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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Kill off a pile of monitor_printf's and cur_mon usage. The only one left in wavcapture.c is the info case. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster Reviewed-by: Michael S. Tsirkin --- audio/wavcapture.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/audio/wavcapture.c b/audio/wavcapture.c index cf31ed652c..cd24570aa7 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -38,30 +38,29 @@ static void wav_destroy (void *opaque) uint8_t dlen[4]; uint32_t datalen =3D wav->bytes; uint32_t rifflen =3D datalen + 36; - Monitor *mon =3D cur_mon; =20 if (wav->f) { le_store (rlen, rifflen, 4); le_store (dlen, datalen, 4); =20 if (fseek (wav->f, 4, SEEK_SET)) { - monitor_printf (mon, "wav_destroy: rlen fseek failed\nReason: = %s\n", - strerror (errno)); + error_report("wav_destroy: rlen fseek failed: %s", + strerror(errno)); goto doclose; } if (fwrite (rlen, 4, 1, wav->f) !=3D 1) { - monitor_printf (mon, "wav_destroy: rlen fwrite failed\nReason = %s\n", - strerror (errno)); + error_report("wav_destroy: rlen fwrite failed: %s", + strerror(errno)); goto doclose; } if (fseek (wav->f, 32, SEEK_CUR)) { - monitor_printf (mon, "wav_destroy: dlen fseek failed\nReason %= s\n", - strerror (errno)); + error_report("wav_destroy: dlen fseek failed: %s", + strerror(errno)); goto doclose; } if (fwrite (dlen, 1, 4, wav->f) !=3D 4) { - monitor_printf (mon, "wav_destroy: dlen fwrite failed\nReason = %s\n", - strerror (errno)); + error_report("wav_destroy: dlen fwrite failed: %s", + strerror(errno)); goto doclose; } doclose: @@ -78,8 +77,7 @@ static void wav_capture (void *opaque, void *buf, int siz= e) WAVState *wav =3D opaque; =20 if (fwrite (buf, size, 1, wav->f) !=3D 1) { - monitor_printf (cur_mon, "wav_capture: fwrite error\nReason: %s", - strerror (errno)); + error_report("wav_capture: fwrite error: %s", strerror(errno)); } wav->bytes +=3D size; } @@ -110,7 +108,6 @@ static struct capture_ops wav_capture_ops =3D { int wav_start_capture (CaptureState *s, const char *path, int freq, int bits, int nchannels) { - Monitor *mon =3D cur_mon; WAVState *wav; uint8_t hdr[] =3D { 0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, @@ -124,13 +121,13 @@ int wav_start_capture (CaptureState *s, const char *p= ath, int freq, CaptureVoiceOut *cap; =20 if (bits !=3D 8 && bits !=3D 16) { - monitor_printf (mon, "incorrect bit count %d, must be 8 or 16\n", = bits); + error_report("incorrect bit count %d, must be 8 or 16", bits); return -1; } =20 if (nchannels !=3D 1 && nchannels !=3D 2) { - monitor_printf (mon, "incorrect channel count %d, must be 1 or 2\n= ", - nchannels); + error_report("incorrect channel count %d, must be 1 or 2", + nchannels); return -1; } =20 @@ -158,8 +155,8 @@ int wav_start_capture (CaptureState *s, const char *pat= h, int freq, =20 wav->f =3D fopen (path, "wb"); if (!wav->f) { - monitor_printf (mon, "Failed to open wave file `%s'\nReason: %s\n", - path, strerror (errno)); + error_report("Failed to open wave file `%s': %s", + path, strerror(errno)); g_free (wav); return -1; } @@ -170,14 +167,13 @@ int wav_start_capture (CaptureState *s, const char *p= ath, int freq, wav->freq =3D freq; =20 if (fwrite (hdr, sizeof (hdr), 1, wav->f) !=3D 1) { - monitor_printf (mon, "Failed to write header\nReason: %s\n", - strerror (errno)); + error_report("Failed to write header: %s", strerror(errno)); goto error_free; } =20 cap =3D AUD_add_capture (&as, &ops, wav); if (!cap) { - monitor_printf (mon, "Failed to add audio capture\n"); + error_report("Failed to add audio capture"); goto error_free; } =20 @@ -189,8 +185,7 @@ int wav_start_capture (CaptureState *s, const char *pat= h, int freq, error_free: g_free (wav->path); if (fclose (wav->f)) { - monitor_printf (mon, "Failed to close wave file\nReason: %s\n", - strerror (errno)); + error_report("Failed to close wave file: %s", strerror(errno)); } g_free (wav); return -1; --=20 2.20.1