From nobody Sun Apr 12 02:50:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1771854930; cv=none; d=zohomail.com; s=zohoarc; b=MOij0OMnL60MYfGsyiLaR7T4lBxSI2F/frEIdr3SG82VnqRqZSwDGpuPQ67l5iReO2/uA381Ux0yoNcxBEMqmKyFZel0RFKN9timzCHqjZnwOFjABDGUyZjOYJdwt5JL0WZnd6KAirdwm5LXIKPjQYqsGflmgGocK+SuvGkHDxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771854930; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KVxGTqGui8DihhEqyeAGveMoKpNCaaSNpKNzs+Wt8ck=; b=TAgXW7T8HfowJhLrv4Uc8Zy/SUsxmAbRWEp/4zvCN8D78ELNeATXuCVVUtdSoTa+p9Z4APHeA8SvFTQvAmkbR+W42zKgmqFJMDDLp4ZLy5JWIyP0AIU620ioZqYzpkzLlLEq78wpjOANfv70eM2XnIPnICBmF6eDfFI0yt7feAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771854930810120.80781274024366; Mon, 23 Feb 2026 05:55:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuWMq-0000ky-JN; Mon, 23 Feb 2026 08:52:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vuWKn-00066s-S7 for qemu-devel@nongnu.org; Mon, 23 Feb 2026 08:51:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vuWKl-0007Yq-02 for qemu-devel@nongnu.org; Mon, 23 Feb 2026 08:50:48 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-zIUnSbBjPwePfku5wEq08A-1; Mon, 23 Feb 2026 08:50:43 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 031651956095; Mon, 23 Feb 2026 13:50:42 +0000 (UTC) Received: from localhost (unknown [10.45.242.25]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2253F1800670; Mon, 23 Feb 2026 13:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771854646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KVxGTqGui8DihhEqyeAGveMoKpNCaaSNpKNzs+Wt8ck=; b=Tveip75Bl7e/V6kSbB5SC+jK0Rr3IsXaY5M/o+auv4TRXdMNflZGlBdYVDYTk1o0wKg9QT mbypUXLntJ+uROwQj+s/WbDgeaegqfVQinwQnaVr4Hj5xHiTELLTogpNWZCO2ODsL2Ge7Z AE70U6beUbSnFUFHEr6rP7tTpFye77U= X-MC-Unique: zIUnSbBjPwePfku5wEq08A-1 X-Mimecast-MFC-AGG-ID: zIUnSbBjPwePfku5wEq08A_1771854642 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Thomas Huth Subject: [PULL v3 68/85] audio/sdl: replace custom logging with error_report Date: Mon, 23 Feb 2026 14:47:09 +0100 Message-ID: <20260223134731.2377432-69-marcandre.lureau@redhat.com> In-Reply-To: <20260223134731.2377432-1-marcandre.lureau@redhat.com> References: <20260223134731.2377432-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1771854932829158500 From: Marc-Andr=C3=A9 Lureau Replace the custom audio logging infrastructure (dolog macro and AUD_log/AUD_vlog) with standard QEMU error reporting (error_report, error_printf, error_vprintf). Note that we also dropped the abort() call in DEBUG_AUDIO, as it is not usually compiled with, doesn't help much, and can easily be added back when doing development as needed. Reviewed-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Akihiko Odaki Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/sdlaudio.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index d974d7eac46..5f332678209 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -26,6 +26,7 @@ #include #include #include "qemu/module.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/audio.h" #include "qom/object.h" @@ -38,7 +39,6 @@ #endif #endif =20 -#define AUDIO_CAP "sdl" #include "audio_int.h" =20 #define TYPE_AUDIO_SDL "audio-sdl" @@ -67,17 +67,6 @@ typedef struct SDLVoiceIn { SDL_AudioDeviceID devid; } SDLVoiceIn; =20 -static void G_GNUC_PRINTF (1, 2) sdl_logerr (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - AUD_vlog (AUDIO_CAP, fmt, ap); - va_end (ap); - - AUD_log (AUDIO_CAP, "Reason: %s\n", SDL_GetError ()); -} - static int aud_to_sdlfmt (AudioFormat fmt) { switch (fmt) { @@ -102,10 +91,7 @@ static int aud_to_sdlfmt (AudioFormat fmt) return AUDIO_F32LSB; =20 default: - dolog ("Internal logic error: Bad audio format %d\n", fmt); -#ifdef DEBUG_AUDIO - abort (); -#endif + error_report("sdl: internal logic error: bad audio format %d", fmt= ); return AUDIO_U8; } } @@ -164,7 +150,7 @@ static int sdl_to_audfmt(int sdlfmt, AudioFormat *fmt, = int *endianness) break; =20 default: - dolog ("Unrecognized SDL audio format %d\n", sdlfmt); + error_report("sdl: unrecognized audio format %d", sdlfmt); return -1; } =20 @@ -182,27 +168,27 @@ static SDL_AudioDeviceID sdl_open(SDL_AudioSpec *req,= SDL_AudioSpec *obt, /* Make sure potential threads created by SDL don't hog signals. */ err =3D sigfillset (&new); if (err) { - dolog ("sdl_open: sigfillset failed: %s\n", strerror (errno)); + error_report("sdl: sigfillset failed: %s", strerror (errno)); return 0; } err =3D pthread_sigmask (SIG_BLOCK, &new, &old); if (err) { - dolog ("sdl_open: pthread_sigmask failed: %s\n", strerror (err)); + error_report("sdl: pthread_sigmask failed: %s", strerror (err)); return 0; } #endif =20 devid =3D SDL_OpenAudioDevice(NULL, rec, req, obt, 0); if (!devid) { - sdl_logerr("SDL_OpenAudioDevice for %s failed\n", - rec ? "recording" : "playback"); + error_report("SDL_OpenAudioDevice for %s failed: %s", + rec ? "recording" : "playback", SDL_GetError()); } =20 #ifndef _WIN32 err =3D pthread_sigmask (SIG_SETMASK, &old, NULL); if (err) { - dolog ("sdl_open: pthread_sigmask (restore) failed: %s\n", - strerror (errno)); + error_report("sdl: pthread_sigmask (restore) failed: %s", + strerror (errno)); /* We have failed to restore original signal mask, all bets are of= f, so exit the process */ exit (EXIT_FAILURE); @@ -233,8 +219,6 @@ static void sdl_callback_out(void *opaque, Uint8 *buf, = int len) =20 if (!sdl->exit) { =20 - /* dolog("callback_out: len=3D%d avail=3D%zu\n", len, hw->pending_= emul); */ - while (hw->pending_emul && len) { size_t write_len, start; =20 @@ -283,8 +267,6 @@ static void sdl_callback_in(void *opaque, Uint8 *buf, i= nt len) return; } =20 - /* dolog("callback_in: len=3D%d pending=3D%zu\n", len, hw->pending_emu= l); */ - while (hw->pending_emul < hw->size_emul && len) { size_t read_len =3D MIN(len, MIN(hw->size_emul - hw->pos_emul, hw->size_emul - hw->pending_emul)); --=20 2.53.0