From nobody Thu Oct 30 15:35:57 2025 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=1761037896; cv=none; d=zohomail.com; s=zohoarc; b=JhQIm3Wg8i/xO2IeYHluo9CT23h5yJ5li7eL3nciAJnmx0ftCZmaUc5IrHo+gWEeaUtQIJT/u1mkvGJ2fH/6X1Un6R9AdeYGSPDEfe362Q5aQ0bGp9z7NhM+p4ZfquIvJjGKr9HuMEnknYyWIpv/ptPVNwq6dYHgWoK8Amj1rZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037896; 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=fWre/z+vR/CLqO7zzWmcSy+RcJw8bmgEDmfOcom/YjM=; b=ayhlcODy/Wmwu16n9q8KTLL20hxjU861fhXQ7DcUoxAASxiGigK5f+3a92NMinlF027T65RKeNUlqp47HZpOcXxBxNJuLLMUqE6etxXx/4AMeTE16C9Nqf1QRPCL9tvg2sFlXFHlm+r6R8cx+jsQ+pkaQKw6GM0Uf60nskoVhj4= 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 1761037896498426.4176664754077; Tue, 21 Oct 2025 02:11:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8HQ-0001E7-Dn; Tue, 21 Oct 2025 05:03:44 -0400 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 1vB8HL-0001DE-33 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8HH-0003tI-2v for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:36 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-332-hyWAkD73OeCk9xc0to2nLg-1; Tue, 21 Oct 2025 05:03:29 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 733B9180065F; Tue, 21 Oct 2025 09:03:28 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D27F41955F22; Tue, 21 Oct 2025 09:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037413; 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=fWre/z+vR/CLqO7zzWmcSy+RcJw8bmgEDmfOcom/YjM=; b=cGyp7ehAxC+kbQfha8PDKwi6TRLOYmPSyvy9WzsqvK56LXn9fBI+fQqL5OV0EdbCGb083L U1Gf5H+ir8na66SFm09kY7gaiHfnWnvvMox7OvgdhxqZAD620DzSgCfqNfeLG7SXzSGxvh W9qt0zHp3LgPpkt4U93nBXw0d6yst94= X-MC-Unique: hyWAkD73OeCk9xc0to2nLg-1 X-Mimecast-MFC-AGG-ID: hyWAkD73OeCk9xc0to2nLg_1761037408 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 01/43] hw/audio: improve error reports Date: Tue, 21 Oct 2025 13:02:32 +0400 Message-ID: <20251021090317.425409-2-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037899114154100 From: Marc-Andr=C3=A9 Lureau The -audiodev argument is 'model=3D..', use same terminology. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/soundhw.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index d18fd9fa05..b06552e7a8 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -70,7 +70,7 @@ void show_valid_soundhw(void) struct soundhw *c; =20 if (soundhw_count) { - printf("Valid sound card names (comma separated):\n"); + printf("Valid audio device model names:\n"); for (c =3D soundhw; c->name; ++c) { printf ("%-11s %s\n", c->name, c->descr); } @@ -88,7 +88,7 @@ void select_soundhw(const char *name, const char *audiode= v) struct soundhw *c; =20 if (selected) { - error_report("only one -soundhw option is allowed"); + error_report("only one -audio option is allowed"); exit(1); } =20 @@ -101,7 +101,7 @@ void select_soundhw(const char *name, const char *audio= dev) } =20 if (!c->name) { - error_report("Unknown sound card name `%s'", name); + error_report("Unknown audio device model `%s'", name); show_valid_soundhw(); exit(1); } @@ -140,4 +140,3 @@ void soundhw_init(void) c->init_pci(pci_bus, audiodev_id); } } - --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037777; cv=none; d=zohomail.com; s=zohoarc; b=h8WUlnjj3aMzOxFQJ/NIeY8RtGhp9mSSFhKPmnyK4k1LIJdZ09b1UySUPontQnxryzZ38ELygGx9A976IiJdtHHVW0DTs8jLcjH3VPAyrvG8znbx7ACD/LLlH/UbH59X6a7vZeP3p8vGODiucj5CGA+paqggU7VZsPb4MnFUN8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037777; 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=n/xAV+2Lt/HYeRsni+7q5oxVBDVj2z/c8SKiYPO847U=; b=TGJVDn1CjUwNW9AnPczI0ulPXGjNmQzsVTV7HR5SOMbJNCmXrkSrwlCoxQRLY5+j5Yne047eDNr8V8PxjEX9OaPX5r2w37Cbav+UjoxldFb6it3nE8N0t5LkTfbODYKbqkMNFiQxdPCpGwwHQteW+gNhA9ybmvYDU8R/uIllq1A= 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 1761037777638848.531551888403; Tue, 21 Oct 2025 02:09:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8HT-0001EG-0W; Tue, 21 Oct 2025 05:03:47 -0400 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 1vB8HO-0001Dv-Lt for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:43 -0400 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 1vB8HN-0003u1-0e for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:42 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-lW54-vqVPaWOPj-GKodwVw-1; Tue, 21 Oct 2025 05:03:36 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 53BD11800669; Tue, 21 Oct 2025 09:03:34 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9CA7F180035A; Tue, 21 Oct 2025 09:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037419; 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=n/xAV+2Lt/HYeRsni+7q5oxVBDVj2z/c8SKiYPO847U=; b=DQGSLFdPXaV0rwxOSr+ohqynsDTod67zy3F7ysd89n3ZFw0vNNJN0HEjshTh+Nfjj2evlK Ruz8BqHCR1ce3aosCnLPOhrloP/yd8H8nunsN9gPh0etBf69TjMhGDpmLQcd+wEVkLcegc /qqApjGLRz3Kc8OyCA9We+qkgip+Rlc= X-MC-Unique: lW54-vqVPaWOPj-GKodwVw-1 X-Mimecast-MFC-AGG-ID: lW54-vqVPaWOPj-GKodwVw_1761037414 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 02/43] hw/audio: rename model list function Date: Tue, 21 Oct 2025 13:02:33 +0400 Message-ID: <20251021090317.425409-3-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037779823154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/audio/soundhw.h | 2 +- hw/audio/soundhw.c | 4 ++-- system/vl.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h index 474c5ff94e..83b3011083 100644 --- a/include/hw/audio/soundhw.h +++ b/include/hw/audio/soundhw.h @@ -7,7 +7,7 @@ void deprecated_register_soundhw(const char *name, const ch= ar *descr, int isa, const char *typename); =20 void soundhw_init(void); -void show_valid_soundhw(void); +void audio_print_available_models(void); void select_soundhw(const char *name, const char *audiodev); =20 #endif diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index b06552e7a8..aca077f5ae 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -65,7 +65,7 @@ void deprecated_register_soundhw(const char *name, const = char *descr, soundhw_count++; } =20 -void show_valid_soundhw(void) +void audio_print_available_models(void) { struct soundhw *c; =20 @@ -102,7 +102,7 @@ void select_soundhw(const char *name, const char *audio= dev) =20 if (!c->name) { error_report("Unknown audio device model `%s'", name); - show_valid_soundhw(); + audio_print_available_models(); exit(1); } } diff --git a/system/vl.c b/system/vl.c index 646239e4a6..d20a9cbe08 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3077,7 +3077,7 @@ void qemu_init(int argc, char **argv) model =3D g_strdup(qdict_get_str(dict, "model")); qdict_del(dict, "model"); if (is_help_option(model)) { - show_valid_soundhw(); + audio_print_available_models(); exit(0); } } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037631; cv=none; d=zohomail.com; s=zohoarc; b=Wc+884b0AEfbUaxCc/okyBj+jc0+r3xGMNgbS7OIJEuphVYfx5ehgizN9/xPHrmrE2KPRwygh/7dTHKe4InnHM+ok4N5qX3qJ+meEH4dxAM2V1i4uXWW+7a0SYse7Jw8cbZp5PHscxccMvm12sIlyc74n8ibzjxyiZL6OjFQR9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037631; 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=8+aePS60Khl4gHn3swsWqHuO8NvOTF+3TPkXO481BGA=; b=gfCfnCJCTNtkhR2S2o2sRBY8lf7u+cc1B11a02Zv7gMxIerpt4C7pjs3FPj2T51+R5LsDJxPVCPAtH+OHq9j8bLppRPklyz0qxBr/IXi/EYgtOhJeANt5l5gM7sCEvegtYf84vx96c3UFpjiAHGs8KW/BXQjuJHrCJh8QR7zGV4= 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 1761037631340552.7932493975482; Tue, 21 Oct 2025 02:07:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8HZ-0001F1-02; Tue, 21 Oct 2025 05:03:53 -0400 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 1vB8HY-0001Es-1Q for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:52 -0400 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 1vB8HR-0003uX-B4 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:49 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-JI0oIKQLPqis6zOttkRugA-1; Tue, 21 Oct 2025 05:03:41 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E626A18002EC; Tue, 21 Oct 2025 09:03:39 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 656FB1800452; Tue, 21 Oct 2025 09:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037424; 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=8+aePS60Khl4gHn3swsWqHuO8NvOTF+3TPkXO481BGA=; b=UsQ/z3Y7IJDpQiIXtUCaVFYRLH00/Dvi4opvyKI7UsrMHqGUsCHc8s506ekoAstKTOk3BK osxm0ccS912O9+URzjou4fDqbMbchQr13n9wU6neOzVVkLRErqVCNF2gJOKpgbGnm9B18O wgZbMlElEDfltpNeUHCREqnxGEuw2n0= X-MC-Unique: JI0oIKQLPqis6zOttkRugA-1 X-Mimecast-MFC-AGG-ID: JI0oIKQLPqis6zOttkRugA_1761037420 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 03/43] hw/audio: remove global pcspk Date: Tue, 21 Oct 2025 13:02:34 +0400 Message-ID: <20251021090317.425409-4-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037641907158500 From: Marc-Andr=C3=A9 Lureau It is no longer used since commit 6033b9ecd4 ("pc: remove -soundhw pcspk") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/pcspk.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index a419161b5b..1b0cc08119 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -60,7 +60,6 @@ struct PCSpkState { }; =20 static const char *s_spk =3D "pcspk"; -static PCSpkState *pcspk_state; =20 static inline void generate_samples(PCSpkState *s) { @@ -192,8 +191,6 @@ static void pcspk_realizefn(DeviceState *dev, Error **e= rrp) if (s->card.state && AUD_register_card(s_spk, &s->card, errp)) { pcspk_audio_init(s); } - - pcspk_state =3D s; } =20 static bool migrate_needed(void *opaque) @@ -229,7 +226,6 @@ static void pcspk_class_initfn(ObjectClass *klass, cons= t void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->vmsd =3D &vmstate_spk; device_class_set_props(dc, pcspk_properties); - /* Reason: realize sets global pcspk_state */ /* Reason: pit object link */ dc->user_creatable =3D false; } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037538; cv=none; d=zohomail.com; s=zohoarc; b=fxgWD3x3IZDXB+LRgAHk4ATDLUWLrAq0WkCwEhuGE3roMpQQ22oOB3MFQykJ0Ba4wTsqLnb1/+R1Y8Yii9nDP6nZmxH1O2OVOl+4br9/woRQXyc/HPkcSVuJk1VzRFnTkf6DtegIyFCaw5PWZVZAyr8pR+QjAMVXOGvPrdw6Q78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037538; 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=oRJnHg9mCdPZO18IoDbCGbmaztLw98nZx1iDHyng678=; b=Qow2V3rbOAr4BhYaK/oMWunjpOlhE16tpjFQtWWoZFWBPX+BlnTnKirbxlL7YrKvujYywyyPrBHxs867Oc6EXYX/o06WGok67fWzEugE3SE5REZGotXY/5EWo4+FYYxfvjoK1uP4CgbO/+WBAc8BBTzxX43fq/2iU+LrKNsX7gk= 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 1761037538473666.4812926527932; Tue, 21 Oct 2025 02:05:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Hc-0001Fn-Ma; Tue, 21 Oct 2025 05:03:56 -0400 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 1vB8Hb-0001Fb-SY for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:55 -0400 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 1vB8HX-0003uw-TJ for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:54 -0400 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-561-JxEKliB3M_qqMYuJlpZM9w-1; Tue, 21 Oct 2025 05:03:46 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 A3AEB19560B0; Tue, 21 Oct 2025 09:03:45 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2031F1955F22; Tue, 21 Oct 2025 09:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037430; 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=oRJnHg9mCdPZO18IoDbCGbmaztLw98nZx1iDHyng678=; b=Wbh+xdzzMZV/SmokSJBcRYQXnWrVBF/riQchscfeP//7ao0dMqK63Z+yZC6ixC+14p0vIs lIZ6jEaBbz81YJRZM/7JBH3KCN9jtxfQk8oVZWGPaiWn2yqR4RqcARLzcu/DOs3bqCNhUs NJzuDoJrv8ymvbwHCtf9+6Ea1fo29lg= X-MC-Unique: JxEKliB3M_qqMYuJlpZM9w-1 X-Mimecast-MFC-AGG-ID: JxEKliB3M_qqMYuJlpZM9w_1761037425 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , "Michael S. Tsirkin" Subject: [PATCH 04/43] hw/pcspk: use explicitly the required PIT types Date: Tue, 21 Oct 2025 13:02:35 +0400 Message-ID: <20251021090317.425409-5-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037541423154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/timer/i8254.h | 4 ++-- hw/audio/pcspk.c | 2 +- hw/timer/i8254_common.c | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 8402caad30..f7148d9286 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -75,7 +75,7 @@ static inline ISADevice *kvm_pit_init(ISABus *bus, int ba= se) return d; } =20 -void pit_set_gate(ISADevice *dev, int channel, int val); -void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *inf= o); +void pit_set_gate(PITCommonState *pit, int channel, int val); +void pit_get_channel_info(PITCommonState *pit, int channel, PITChannelInfo= *info); =20 #endif /* HW_I8254_H */ diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 1b0cc08119..60cedcb375 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -50,7 +50,7 @@ struct PCSpkState { uint8_t sample_buf[PCSPK_BUF_LEN]; QEMUSoundCard card; SWVoiceOut *voice; - void *pit; + PITCommonState *pit; unsigned int pit_count; unsigned int samples; unsigned int play_pos; diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c index ad091594cd..419d4cd6e5 100644 --- a/hw/timer/i8254_common.c +++ b/hw/timer/i8254_common.c @@ -32,9 +32,8 @@ #include "migration/vmstate.h" =20 /* val must be 0 or 1 */ -void pit_set_gate(ISADevice *dev, int channel, int val) +void pit_set_gate(PITCommonState *pit, int channel, int val) { - PITCommonState *pit =3D PIT_COMMON(dev); PITChannelState *s =3D &pit->channels[channel]; PITCommonClass *c =3D PIT_COMMON_GET_CLASS(pit); =20 @@ -139,9 +138,8 @@ void pit_get_channel_info_common(PITCommonState *s, PIT= ChannelState *sc, info->out =3D pit_get_out(sc, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)); } =20 -void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *inf= o) +void pit_get_channel_info(PITCommonState *pit, int channel, PITChannelInfo= *info) { - PITCommonState *pit =3D PIT_COMMON(dev); PITChannelState *s =3D &pit->channels[channel]; PITCommonClass *c =3D PIT_COMMON_GET_CLASS(pit); =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037561; cv=none; d=zohomail.com; s=zohoarc; b=BKfnLahm2RLaPOWyCwv/kSJYBOVf+CrM1uilr6UlsUGKuyU+OFcv8fbeJ7KPSgJxR6Ow9AMRR9DYWUvkyhZfKPaSed1YRBXRb1pXgkQhK2mecG1K1czvaHtfj2EWyDLk+5NM6OlRfHAFeaQyT01GLpN1JWlYZaSXbygkjooHTqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037561; 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=d3HE1DRQvIPUkpsGTEbByNYsb2kKTtuaKAp1eDeFgZo=; b=MvtLHL6l2hOpJ4QBHUSwtK87PavXpQDR/6tKccxoXQJQqTJbToB5n+vT3GZGPCgn3h6EWpCzT132eIyQonRkg5p8PW3s18SBAM9NkfsIRpwDi9in0NgKzberq7OvLXlTLXYZse7ZivPdf490l5wX2caWDtubz9sKREXGdccsGg0= 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 1761037561392629.360554182824; Tue, 21 Oct 2025 02:06:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Hi-0001Gm-3V; Tue, 21 Oct 2025 05:04:02 -0400 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 1vB8Hf-0001GL-MM for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:59 -0400 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 1vB8Hd-0003vP-1Q for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:03:58 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-73-PLEKuUShOMONw1La3Dsrig-1; Tue, 21 Oct 2025 05:03:52 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0866618002DD; Tue, 21 Oct 2025 09:03:51 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D157F1955F22; Tue, 21 Oct 2025 09:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037435; 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=d3HE1DRQvIPUkpsGTEbByNYsb2kKTtuaKAp1eDeFgZo=; b=HsSyOmnZNKQYlKDjEuXKZlgn/yUeMnpthq/k9yqHrBmRPFf9Lpx4UrDF/7PS6A5IYu3RLZ TzOpZKHwCflUabLmamWrMovhHeWC+nVd2tbWebKDFQ9hUbLZRACUoaWiwj9M9LyxQdpZ5F cxRgsPkUaMKoLu8PXS1j/RLjqqOMHpc= X-MC-Unique: PLEKuUShOMONw1La3Dsrig-1 X-Mimecast-MFC-AGG-ID: PLEKuUShOMONw1La3Dsrig_1761037431 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 05/43] hw/pcspk: make 'pit' a class property Date: Tue, 21 Oct 2025 13:02:36 +0400 Message-ID: <20251021090317.425409-6-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037563087158500 From: Marc-Andr=C3=A9 Lureau This should be functionally equivalent. (for some reason, the device property was convert to an object instance property in commit 873b4d3f0571) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/pcspk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 60cedcb375..40572241cb 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -174,11 +174,6 @@ static void pcspk_initfn(Object *obj) PCSpkState *s =3D PC_SPEAKER(obj); =20 memory_region_init_io(&s->ioport, OBJECT(s), &pcspk_io_ops, s, "pcspk"= , 1); - - object_property_add_link(obj, "pit", TYPE_PIT_COMMON, - (Object **)&s->pit, - qdev_prop_allow_set_link_before_realize, - 0); } =20 static void pcspk_realizefn(DeviceState *dev, Error **errp) @@ -216,6 +211,7 @@ static const Property pcspk_properties[] =3D { DEFINE_AUDIO_PROPERTIES(PCSpkState, card), DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, 0x61), DEFINE_PROP_BOOL("migrate", PCSpkState, migrate, true), + DEFINE_PROP_LINK("pit", PCSpkState, pit, TYPE_PIT_COMMON, PITCommonSta= te *), }; =20 static void pcspk_class_initfn(ObjectClass *klass, const void *data) --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037681; cv=none; d=zohomail.com; s=zohoarc; b=iPQp0PFT11InqDk/itgwP5qcrT6Cn8j6u/Rn5JZOnmpOrKm1PI4bHheuuuIJAVWo4k+W0ur++Bu7tISFB7lY6kbDGF/EXiJYeD0uAgXM2IVOKhW3zAganvXP0zA3x8wKVxgCWRnlFWVo56iaY2GzBF4ar37bYnisMpBClXS2gdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037681; 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=DuHgBn6v7c8UQAR8rBWZJ/UAAtSM19kE3jiv1Od/ysc=; b=jr9dBVWKpwv+bllHQ4fV8hU1l9SAJ4x7RgtV7KYFcfgjYsqQchJRrqDoNBaDrxwyw5dpzXOE+cgV2Zhr+Yl7ygruSki912UrN3XmhzY5QaHiOV4T2Core7fY4zg0zPQ3OihtlOGD4QBYsiB9Q6GJAXOHn6QJ68VmruyEmElCz64= 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 176103768142684.15809049387485; Tue, 21 Oct 2025 02:08:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Hs-0001Is-4l; Tue, 21 Oct 2025 05:04:12 -0400 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 1vB8Hn-0001I2-WC for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Hk-0003vu-2H for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:06 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-l5oIt6scPMmxfuT148O56w-1; Tue, 21 Oct 2025 05:03:57 -0400 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 565C518002EC; Tue, 21 Oct 2025 09:03:56 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 02FAB180057C; Tue, 21 Oct 2025 09:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037443; 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=DuHgBn6v7c8UQAR8rBWZJ/UAAtSM19kE3jiv1Od/ysc=; b=EA0FiXc56iTwKKOJbnMP3FbtofsIr6BNRImLmaybeBQuWEPGfPEC3Y/ApGjIdiaWarsmXE E/GK4hqrLn4t1A/F2JR9m+g4mjaH1O6x0+vXA/JGt5c+soBcB3dIu9raDodYbB+VggK9Q4 S0R67eB+XS5I0LdJdxCSIWHa/0T8blY= X-MC-Unique: l5oIt6scPMmxfuT148O56w-1 X-Mimecast-MFC-AGG-ID: l5oIt6scPMmxfuT148O56w_1761037436 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 06/43] hw/pcspk: check the "pit" is set Date: Tue, 21 Oct 2025 13:02:37 +0400 Message-ID: <20251021090317.425409-7-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037684554158500 From: Marc-Andr=C3=A9 Lureau We don't let the user create a "isa-pcspk" via -device yet (in theory, we could, and fallback on a lookup PIT), but we can add some safety checks that the property was correctly set nonetheless. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/pcspk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 40572241cb..8ea3a161a4 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -181,6 +181,11 @@ static void pcspk_realizefn(DeviceState *dev, Error **= errp) ISADevice *isadev =3D ISA_DEVICE(dev); PCSpkState *s =3D PC_SPEAKER(dev); =20 + if (!s->pit) { + error_setg(errp, "pcspk: No \"pit\" set or available"); + return; + } + isa_register_ioport(isadev, &s->ioport, s->iobase); =20 if (s->card.state && AUD_register_card(s_spk, &s->card, errp)) { --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037532; cv=none; d=zohomail.com; s=zohoarc; b=LalBhfIWbz1AVyY8lmE0PmJLDhNfMWstDlRrytHwgwh76APyKw6lvmLQxh0mNiq1Q7OqhT4BEfumGDUudGnE/TXduzZe/wGIs/TU7zPlKfEsCvekUmKFgvJNBrhAUarm327M5w5Qpnh/xnd8wCJQjr7qu61pKweV/hgD7vImvd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037532; 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=J9IAdG5rzuIrqLOFVf+CxNICco+IVeMK3mKBrGKBsU4=; b=naPJNLS5e+2XlY1Kb2ngqqnoFgO4awdSU9JZ53PVRxJkcoy8SKtuSoPIllqELWWjL1CuptrCg3u7+5cDdsLTwZ7+49iMd1MRzJLDZlxg00sMYMtfHoQvtn4+mj1Sd3YN3yeatG6wIeT+aj499yU4rS7aoh1g+wwBqMbOnKmQTY4= 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 176103753264916.968017627678705; Tue, 21 Oct 2025 02:05:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ht-0001JD-J1; Tue, 21 Oct 2025 05:04:13 -0400 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 1vB8Hr-0001IS-KZ for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:11 -0400 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 1vB8Hp-0003wG-NP for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:11 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-247-g5xmTvT5MB6rTWqCNmXD3w-1; Tue, 21 Oct 2025 05:04:02 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 95E6E18001D1; Tue, 21 Oct 2025 09:04:01 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5275630001BE; Tue, 21 Oct 2025 09:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037447; 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=J9IAdG5rzuIrqLOFVf+CxNICco+IVeMK3mKBrGKBsU4=; b=VcqH3Uqm2uyK0YI27BlBn910g2BJH7LmSq0viDslXpq/1YesgC72ZelQdbh5+NFEzDgVMQ vlxHdQHsaLe/KXsfwZGOr7YV3Gxv5JJMRSYkpVA3j/9AGLN2WXH7Os6/Pm28pRYLqYBa0A u6+9LdvLonsTDnb8128X4ZddoTHKid0= X-MC-Unique: g5xmTvT5MB6rTWqCNmXD3w-1 X-Mimecast-MFC-AGG-ID: g5xmTvT5MB6rTWqCNmXD3w_1761037441 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 07/43] docs: update -soundhw -> -device list Date: Tue, 21 Oct 2025 13:02:38 +0400 Message-ID: <20251021090317.425409-8-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037535080154100 From: Marc-Andr=C3=A9 Lureau (note: I wonder if pcspk was really an option when -soundhw was available, since it was not user-creatable) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- docs/qdev-device-use.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt index c98c86d828..043ae46114 100644 --- a/docs/qdev-device-use.txt +++ b/docs/qdev-device-use.txt @@ -324,8 +324,10 @@ Map from -soundhw sound card name to -device: gus -device gus,iobase=3DIOADDR,irq=3DIRQ,dma=3DDMA,freq=3DF hda -device intel-hda,msi=3DMSI -device hda-duplex sb16 -device sb16,iobase=3DIOADDR,irq=3DIRQ,dma=3DDMA,dma16=3DD= MA16,version=3DV - adlib not yet available with -device - pcspk not yet available with -device + adlib -device adlib,iobase=3DIOADDR,freq=3DF + + pcspk Not available with -device, + but audiodev can be set with -machine pcspk-audiodev=3D =20 For PCI devices, you can add bus=3DPCI-BUS,addr=3DDEVFN to control the PCI device address, as usual. --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037703; cv=none; d=zohomail.com; s=zohoarc; b=SvclfCXwKo5VjulrOuyTCp40HW8A+6BJJ8eGBKui58aSeG9vjsZaeMhj40WxuV6YF09ntwGSQw0YufClBqrowIGvNKU6zX/x+q6uPQ+b6c1BXmdpStFlhp3LHlA91CRu/SezWvmOn0akPqo6iHcjERSHiSADTw4XYd6yuDVW9CY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037703; 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=2KZIoozjfu2C+xVlZ+aEGmbOyE0e3/BqkuwJq/qKsDc=; b=A9fO3ZO9vDy+XfclbcNYrmg9Sm/5uIZIaoI60XxthBoTHIWC2KCQJbHebNBtZSuzdUEXxl3g5/3mMpfrpekm+M6C5SarMWVyZYYYsKDUuJqexPLc6VGTl7cDGdCIzc0eURL/gBjmLSNgbzbI6HM8nFXqkUQ6G+rBmTV3virnlYk= 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 1761037703178937.7254743170238; Tue, 21 Oct 2025 02:08:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Hx-0001Jl-KN; Tue, 21 Oct 2025 05:04:17 -0400 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 1vB8Hw-0001JO-1K for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:16 -0400 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 1vB8Hu-0003wd-7F for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:15 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-9RF8dQpmMCyr6AMNtNhr3w-1; Tue, 21 Oct 2025 05:04:09 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 45D8B180035D; Tue, 21 Oct 2025 09:04:08 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A8A221954102; Tue, 21 Oct 2025 09:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037453; 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=2KZIoozjfu2C+xVlZ+aEGmbOyE0e3/BqkuwJq/qKsDc=; b=XBUelE1Z+2ETIt7WfDBVyiuh50V8NsNY9Ls22qog7LPskqgU7Bdnw/7NGBn7PIKFVSDB+L NvXXx7Mn4ohNaGR0Hf69N7tU0KdcQ4zPKN8cTbVcwe24OXAZoFowPi4cBz5qatmpg8zZ/4 i/GzgLnuKZbae97HOHFfCu79rlCdpnI= X-MC-Unique: 9RF8dQpmMCyr6AMNtNhr3w-1 X-Mimecast-MFC-AGG-ID: 9RF8dQpmMCyr6AMNtNhr3w_1761037448 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 08/43] qdev: add qdev_find_default_bus() Date: Tue, 21 Oct 2025 13:02:39 +0400 Message-ID: <20251021090317.425409-9-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037706709158500 From: Marc-Andr=C3=A9 Lureau This helper is used next by -audio code. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/monitor/qdev.h | 3 +++ system/qdev-monitor.c | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h index 1d57bf6577..de33637869 100644 --- a/include/monitor/qdev.h +++ b/include/monitor/qdev.h @@ -1,6 +1,8 @@ #ifndef MONITOR_QDEV_H #define MONITOR_QDEV_H =20 +#include "hw/qdev-core.h" + /*** monitor commands ***/ =20 void hmp_info_qtree(Monitor *mon, const QDict *qdict); @@ -11,6 +13,7 @@ int qdev_device_help(QemuOpts *opts); DeviceState *qdev_device_add(QemuOpts *opts, Error **errp); DeviceState *qdev_device_add_from_qdict(const QDict *opts, bool from_json, Error **errp); +BusState *qdev_find_default_bus(DeviceClass *dc, Error **errp); =20 /** * qdev_set_id: parent the device and set its id if provided. diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 2ac92d0a07..4b732f579a 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -621,6 +621,21 @@ const char *qdev_set_id(DeviceState *dev, char *id, Er= ror **errp) return prop->name; } =20 +BusState *qdev_find_default_bus(DeviceClass *dc, Error **errp) +{ + BusState *bus =3D NULL; + + assert(dc->bus_type !=3D NULL); + bus =3D qbus_find_recursive(sysbus_get_default(), NULL, dc->bus_type); + if (!bus || qbus_is_full(bus)) { + error_setg(errp, "No '%s' bus found for device '%s'", + dc->bus_type, object_class_get_name(OBJECT_CLASS(dc))); + return NULL; + } + + return bus; +} + DeviceState *qdev_device_add_from_qdict(const QDict *opts, bool from_json, Error **errp) { @@ -657,10 +672,8 @@ DeviceState *qdev_device_add_from_qdict(const QDict *o= pts, return NULL; } } else if (dc->bus_type !=3D NULL) { - bus =3D qbus_find_recursive(sysbus_get_default(), NULL, dc->bus_ty= pe); - if (!bus || qbus_is_full(bus)) { - error_setg(errp, "No '%s' bus found for device '%s'", - dc->bus_type, driver); + bus =3D qdev_find_default_bus(dc, errp); + if (!bus) { return NULL; } } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037527; cv=none; d=zohomail.com; s=zohoarc; b=bcbILKd5QBrW8ADqdiB0SFrP5je4FF2H6JjR5ghNIE9Xz+AwJNEQGMLJfH+5Z8hKVFLTdawmeh4Voz4cipWF+HnJOSSyl1ZylHz9B9zvVAudmOd8AoHVUfcyQXsvDqzo2x9atTA22+mRmkQxejerkuyCRBrwau0pmMz9FTxIlUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037527; 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=XM5XiiB9fJ9Ksj/BZ6DFiO9dUHFsPS364V1lxa/i93E=; b=VDUu18u/yreZkWWE37yYV8KD6vgrR7Zce0b00ewEXOCeYRLNN5C1v7ETfiIx9wMow/S5qe8i4g3a9A9rNCClgZTnouimbcEzBTqlFTeMLlnego8V/Kwd6uImJN0EOP9FYfdWiP7xcsO+QopAskE2yK+9jcrguV53mVAy7VP0Sqs= 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 1761037527248362.4616419731717; Tue, 21 Oct 2025 02:05:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8I1-0001LL-N1; Tue, 21 Oct 2025 05:04:21 -0400 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 1vB8I0-0001Ky-NX for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Hz-0003wv-3i for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:20 -0400 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-694-Euv3RbEqOwuE8Zi1m7F0IQ-1; Tue, 21 Oct 2025 05:04:14 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 97471195606D; Tue, 21 Oct 2025 09:04:13 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4328B1800451; Tue, 21 Oct 2025 09:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037458; 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=XM5XiiB9fJ9Ksj/BZ6DFiO9dUHFsPS364V1lxa/i93E=; b=Go7EBTz8iVyll/4SSbdi/LGn2imFZhvloXz5bUdv3h91GA4IHm3lPzZVEwNE1CDx2gqc9Z BSDNYeZ+BlaLqE8bT5olARTar8/1w8hklJ+wuzfv0OcKpMiTdLax7iFhoZlgxRPsBqWbW7 HEdXyo+RFlXMd+We2zl5WJEHBzY0RnM= X-MC-Unique: Euv3RbEqOwuE8Zi1m7F0IQ-1 X-Mimecast-MFC-AGG-ID: Euv3RbEqOwuE8Zi1m7F0IQ_1761037453 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 09/43] hw/audio: look up the default bus from the device class Date: Tue, 21 Oct 2025 13:02:40 +0400 Message-ID: <20251021090317.425409-10-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037534974158500 From: Marc-Andr=C3=A9 Lureau Generalize and simplify the device model creation. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/audio/soundhw.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index aca077f5ae..b4a87ff709 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -22,6 +22,8 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "hw/qdev-core.h" +#include "monitor/qdev.h" #include "qemu/option.h" #include "qemu/help_option.h" #include "qemu/error-report.h" @@ -110,33 +112,19 @@ void select_soundhw(const char *name, const char *aud= iodev) void soundhw_init(void) { struct soundhw *c =3D selected; - ISABus *isa_bus =3D (ISABus *) object_resolve_path_type("", TYPE_ISA_B= US, NULL); - PCIBus *pci_bus =3D (PCIBus *) object_resolve_path_type("", TYPE_PCI_B= US, NULL); - BusState *bus; =20 if (!c) { return; } - if (c->isa) { - if (!isa_bus) { - error_report("ISA bus not available for %s", c->name); - exit(1); - } - bus =3D BUS(isa_bus); - } else { - if (!pci_bus) { - error_report("PCI bus not available for %s", c->name); - exit(1); - } - bus =3D BUS(pci_bus); - } =20 if (c->typename) { DeviceState *dev =3D qdev_new(c->typename); + BusState *bus =3D qdev_find_default_bus(DEVICE_GET_CLASS(dev), &er= ror_fatal); qdev_prop_set_string(dev, "audiodev", audiodev_id); qdev_realize_and_unref(dev, bus, &error_fatal); } else { assert(!c->isa); + PCIBus *pci_bus =3D (PCIBus *) object_resolve_path_type("", TYPE_P= CI_BUS, NULL); c->init_pci(pci_bus, audiodev_id); } } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037584; cv=none; d=zohomail.com; s=zohoarc; b=c+FzxlVHTq17twO9ljsAlmO+qO8Jm/pwZOKj1GQGBbyXrA0Jg18RLM+vEtJQVlml3hpRd0S+UgTPpoFPEFuOFcbRt4J+TfZdcmyq4J/ydzuDUTL52m2gLEl3s1Q0JpzetuUx+KXprME1huX8mgeLcUZfriGpwelWdTcyQdVh8MQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037584; 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=WGxJaPkxhbyVTmnJnESZHrCoP7GGlsyqrx5IbxGUxRE=; b=fX3qGGSWz4fuf7X5+CWVbxwGsQU51lB5ohP9TcePaGtsAYjFIDvb4m0aaj8BXudQi5WmVgr2mgIZaY1uJaPtzrYpkibXNSzTP0iB26/s/9UAk0p6Fx/70ObTWMf13X721MmxQ37OEzJqQMymYeJpWrYICdkoeQQvKHoydRpD/W4= 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 1761037584647750.1103298929543; Tue, 21 Oct 2025 02:06:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8I8-0001ML-2J; Tue, 21 Oct 2025 05:04:28 -0400 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 1vB8I4-0001La-R6 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8I2-0003x9-VZ for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:24 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-Wd5bf03NPpypJKGUKz0t4A-1; Tue, 21 Oct 2025 05:04:20 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3BBB71800673; Tue, 21 Oct 2025 09:04:19 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C3E61180035A; Tue, 21 Oct 2025 09:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037461; 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=WGxJaPkxhbyVTmnJnESZHrCoP7GGlsyqrx5IbxGUxRE=; b=Cz28eZOkqbT786+f1lt0xEz8KHJGoJKliN2T48hV0um532nE44tBstZPDtQcVJKZX8TV4c /wtuaegZi2fvuXKfCbW0ama7ZjuNKMcM56j7MXXECtV7JHguv5dXchzetxucnoeo2NX7YR vzMbampherBe7c1R0Q7pWcomxvOEWTo= X-MC-Unique: Wd5bf03NPpypJKGUKz0t4A-1 X-Mimecast-MFC-AGG-ID: Wd5bf03NPpypJKGUKz0t4A_1761037459 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 10/43] audio: rename audio_define->audio_add_audiodev() Date: Tue, 21 Oct 2025 13:02:41 +0400 Message-ID: <20251021090317.425409-11-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037585613154100 From: Marc-Andr=C3=A9 Lureau For readability. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- audio/audio.h | 4 ++-- audio/audio.c | 8 ++++---- system/vl.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index fcc22307be..eb5b5d662d 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -168,8 +168,8 @@ void audio_sample_to_uint64(const void *samples, int po= s, void audio_sample_from_uint64(void *samples, int pos, uint64_t left, uint64_t right); =20 -void audio_define(Audiodev *audio); -void audio_define_default(Audiodev *dev, Error **errp); +void audio_add_audiodev(Audiodev *audio); +void audio_add_default_audiodev(Audiodev *dev, Error **errp); void audio_parse_option(const char *opt); void audio_create_default_audiodevs(void); void audio_init_audiodevs(void); diff --git a/audio/audio.c b/audio/audio.c index 89f091bc88..6197fa1788 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1712,7 +1712,7 @@ void audio_create_default_audiodevs(void) visit_type_Audiodev(v, NULL, &dev, &error_fatal); visit_free(v); =20 - audio_define_default(dev, &error_abort); + audio_add_default_audiodev(dev, &error_abort); } } } @@ -2142,10 +2142,10 @@ void audio_parse_option(const char *opt) visit_type_Audiodev(v, NULL, &dev, &error_fatal); visit_free(v); =20 - audio_define(dev); + audio_add_audiodev(dev); } =20 -void audio_define(Audiodev *dev) +void audio_add_audiodev(Audiodev *dev) { AudiodevListEntry *e; =20 @@ -2156,7 +2156,7 @@ void audio_define(Audiodev *dev) QSIMPLEQ_INSERT_TAIL(&audiodevs, e, next); } =20 -void audio_define_default(Audiodev *dev, Error **errp) +void audio_add_default_audiodev(Audiodev *dev, Error **errp) { AudiodevListEntry *e; =20 diff --git a/system/vl.c b/system/vl.c index d20a9cbe08..7187b24449 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2264,7 +2264,7 @@ static void qemu_record_config_group(const char *grou= p, QDict *dict, Audiodev *dev =3D NULL; Visitor *v =3D qobject_input_visitor_new_keyval(QOBJECT(dict)); if (visit_type_Audiodev(v, NULL, &dev, errp)) { - audio_define(dev); + audio_add_audiodev(dev); } visit_free(v); =20 @@ -3086,11 +3086,11 @@ void qemu_init(int argc, char **argv) visit_type_Audiodev(v, NULL, &dev, &error_fatal); visit_free(v); if (model) { - audio_define(dev); + audio_add_audiodev(dev); select_soundhw(model, dev->id); g_free(model); } else { - audio_define_default(dev, &error_fatal); + audio_add_default_audiodev(dev, &error_fatal); } break; } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037501; cv=none; d=zohomail.com; s=zohoarc; b=WG9Lcs1ZmI9pKLSwA4gts/HQqBCDlD/xeicJ/NEm6bxDBj2RLevW2KhmLnWpDWJI1k5yP/GTkT4TwQKnf0UuKCX0yuLSYVRJqIHGZJLbGbfD15H+qWlzlgWudAowf89f5Aj9nE1uLIuSZ3QTyL0Y/IdMECvjFH0yFVnJwdMJ/rE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037501; 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=+wt6sb6ECxEGXtba1iyiyGz0oYg1VaDSGGlLXDLDBkw=; b=dYYukjA0EKjSEPk7/258lY2vv2lgxmSeeDXKQ27Ot6s7b58N1kDNXw+vNxntktd5Q3cKb1hq77lzxwxz1IEaUIsv4cBvRAe7GkAoCTU/4Y+NTR9HnKEvZhAcy+YWBATqQ/FJ/lXjBuIoBsmyGYrBsDMOe8GrA6kACJMbLABZtI8= 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 1761037501594326.063374958267; Tue, 21 Oct 2025 02:05:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8II-0001U3-Mi; Tue, 21 Oct 2025 05:04:38 -0400 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 1vB8IF-0001TF-W1 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8IC-0003xZ-BP for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:35 -0400 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-676-W1-M0frRNSOP2V1pTAEgcA-1; Tue, 21 Oct 2025 05:04:26 -0400 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 F377B195608F; Tue, 21 Oct 2025 09:04:24 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6708A180035A; Tue, 21 Oct 2025 09:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037469; 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=+wt6sb6ECxEGXtba1iyiyGz0oYg1VaDSGGlLXDLDBkw=; b=bdWMzZxLG0ZLeg12wH5afDDLk/dpe5mEABe3yfDMODyo4AZ1sn8AbEe4xxSIdjZdIwj6Vw 0a+EnKJVCuN17Qa2dj3LaLbXVZjiae9G/CMpDskxkQkoaSxKAFh4x9u0gjxJWxB/hDDEKm aHRUQiGfDW9omY48gqSU1X/HNvY4WIA= X-MC-Unique: W1-M0frRNSOP2V1pTAEgcA-1 X-Mimecast-MFC-AGG-ID: W1-M0frRNSOP2V1pTAEgcA_1761037465 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Manos Pitsidianakis , "Michael S. Tsirkin" , Eduardo Habkost Subject: [PATCH 11/43] hw/audio: use better naming for -audio model handling code Date: Tue, 21 Oct 2025 13:02:42 +0400 Message-ID: <20251021090317.425409-12-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037505516154100 From: Marc-Andr=C3=A9 Lureau All the functions are about "-audio model=3D" handling, a simpler way to setup audio. Rename functions/variables to reflect this better. audio_register_model_with_cb() dropped "pci" from the name, since it will be generalized next. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/audio/model.h | 13 +++++ include/hw/audio/soundhw.h | 13 ----- hw/audio/ac97.c | 5 +- hw/audio/adlib.c | 4 +- hw/audio/cs4231a.c | 4 +- hw/audio/es1370.c | 5 +- hw/audio/gus.c | 4 +- hw/audio/intel-hda.c | 4 +- hw/audio/{soundhw.c =3D> model.c} | 58 +++++++++---------- hw/audio/pcspk.c | 2 +- hw/audio/sb16.c | 5 +- hw/audio/virtio-snd-pci.c | 4 +- system/vl.c | 6 +- hw/audio/meson.build | 2 +- .../codeconverter/test_regexps.py | 2 +- 15 files changed, 64 insertions(+), 67 deletions(-) create mode 100644 include/hw/audio/model.h delete mode 100644 include/hw/audio/soundhw.h rename hw/audio/{soundhw.c =3D> model.c} (68%) diff --git a/include/hw/audio/model.h b/include/hw/audio/model.h new file mode 100644 index 0000000000..27ae7dcc31 --- /dev/null +++ b/include/hw/audio/model.h @@ -0,0 +1,13 @@ +#ifndef HW_AUDIO_MODEL_H +#define HW_AUDIO_MODEL_H + +void audio_register_model_with_cb(const char *name, const char *descr, + int (*init_pci)(PCIBus *bus, const char = *audiodev)); +void audio_register_model(const char *name, const char *descr, + int isa, const char *typename); + +void audio_model_init(void); +void audio_print_available_models(void); +void audio_set_model(const char *name, const char *audiodev); + +#endif diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h deleted file mode 100644 index 83b3011083..0000000000 --- a/include/hw/audio/soundhw.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef HW_SOUNDHW_H -#define HW_SOUNDHW_H - -void pci_register_soundhw(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus, const char *audiode= v)); -void deprecated_register_soundhw(const char *name, const char *descr, - int isa, const char *typename); - -void soundhw_init(void); -void audio_print_available_models(void); -void select_soundhw(const char *name, const char *audiodev); - -#endif diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index eb7a847080..2e1be5089e 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -18,7 +18,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" @@ -1360,8 +1360,7 @@ static const TypeInfo ac97_info =3D { static void ac97_register_types(void) { type_register_static(&ac97_info); - deprecated_register_soundhw("ac97", "Intel 82801AA AC97 Audio", - 0, TYPE_AC97); + audio_register_model("ac97", "Intel 82801AA AC97 Audio", 0, TYPE_AC97); } =20 type_init(ac97_register_types) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 1f29a7e319..a7c2efd87c 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -323,7 +323,7 @@ static const TypeInfo adlib_info =3D { static void adlib_register_types (void) { type_register_static (&adlib_info); - deprecated_register_soundhw("adlib", ADLIB_DESC, 1, TYPE_ADLIB); + audio_register_model("adlib", ADLIB_DESC, 1, TYPE_ADLIB); } =20 type_init (adlib_register_types) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 6dfff202ff..1f7e0a33c0 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -723,7 +723,7 @@ static const TypeInfo cs4231a_info =3D { static void cs4231a_register_types (void) { type_register_static (&cs4231a_info); - deprecated_register_soundhw("cs4231a", "CS4231A", 1, TYPE_CS4231A); + audio_register_model("cs4231a", "CS4231A", 1, TYPE_CS4231A); } =20 type_init (cs4231a_register_types) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index a6a32a6348..913c9022f6 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -26,7 +26,7 @@ #define VERBOSE_ES1370 0 =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/pci/pci_device.h" #include "migration/vmstate.h" @@ -905,8 +905,7 @@ static const TypeInfo es1370_info =3D { static void es1370_register_types (void) { type_register_static (&es1370_info); - deprecated_register_soundhw("es1370", "ENSONIQ AudioPCI ES1370", - 0, TYPE_ES1370); + audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", 0, TYPE_ES13= 70); } =20 type_init (es1370_register_types) diff --git a/hw/audio/gus.c b/hw/audio/gus.c index c36df0240f..ac9332ea3d 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -319,7 +319,7 @@ static const TypeInfo gus_info =3D { static void gus_register_types (void) { type_register_static (&gus_info); - deprecated_register_soundhw("gus", "Gravis Ultrasound GF1", 1, TYPE_GU= S); + audio_register_model("gus", "Gravis Ultrasound GF1", 1, TYPE_GUS); } =20 type_init (gus_register_types) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index b256c8ccea..6a0db0dd9e 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -26,7 +26,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qemu/error-report.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "intel-hda.h" #include "migration/vmstate.h" #include "intel-hda-defs.h" @@ -1324,7 +1324,7 @@ static void intel_hda_register_types(void) type_register_static(&intel_hda_info_ich6); type_register_static(&intel_hda_info_ich9); type_register_static(&hda_codec_device_type_info); - pci_register_soundhw("hda", "Intel HD Audio", intel_hda_and_codec_init= ); + audio_register_model_with_cb("hda", "Intel HD Audio", intel_hda_and_co= dec_init); } =20 type_init(intel_hda_register_types) diff --git a/hw/audio/soundhw.c b/hw/audio/model.c similarity index 68% rename from hw/audio/soundhw.c rename to hw/audio/model.c index b4a87ff709..668349c69d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/model.c @@ -32,9 +32,9 @@ #include "hw/qdev-properties.h" #include "hw/isa/isa.h" #include "hw/pci/pci.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" =20 -struct soundhw { +struct audio_model { const char *name; const char *descr; const char *typename; @@ -42,38 +42,38 @@ struct soundhw { int (*init_pci) (PCIBus *bus, const char *audiodev); }; =20 -static struct soundhw soundhw[9]; -static int soundhw_count; +static struct audio_model audio_models[9]; +static int audio_models_count; =20 -void pci_register_soundhw(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus, const char *audiode= v)) +void audio_register_model_with_cb(const char *name, const char *descr, + int (*init_pci)(PCIBus *bus, const char = *audiodev)) { - assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); - soundhw[soundhw_count].name =3D name; - soundhw[soundhw_count].descr =3D descr; - soundhw[soundhw_count].isa =3D 0; - soundhw[soundhw_count].init_pci =3D init_pci; - soundhw_count++; + assert(audio_models_count < ARRAY_SIZE(audio_models) - 1); + audio_models[audio_models_count].name =3D name; + audio_models[audio_models_count].descr =3D descr; + audio_models[audio_models_count].isa =3D 0; + audio_models[audio_models_count].init_pci =3D init_pci; + audio_models_count++; } =20 -void deprecated_register_soundhw(const char *name, const char *descr, - int isa, const char *typename) +void audio_register_model(const char *name, const char *descr, + int isa, const char *typename) { - assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); - soundhw[soundhw_count].name =3D name; - soundhw[soundhw_count].descr =3D descr; - soundhw[soundhw_count].isa =3D isa; - soundhw[soundhw_count].typename =3D typename; - soundhw_count++; + assert(audio_models_count < ARRAY_SIZE(audio_models) - 1); + audio_models[audio_models_count].name =3D name; + audio_models[audio_models_count].descr =3D descr; + audio_models[audio_models_count].isa =3D isa; + audio_models[audio_models_count].typename =3D typename; + audio_models_count++; } =20 void audio_print_available_models(void) { - struct soundhw *c; + struct audio_model *c; =20 - if (soundhw_count) { + if (audio_models_count) { printf("Valid audio device model names:\n"); - for (c =3D soundhw; c->name; ++c) { + for (c =3D audio_models; c->name; ++c) { printf ("%-11s %s\n", c->name, c->descr); } } else { @@ -82,19 +82,19 @@ void audio_print_available_models(void) } } =20 -static struct soundhw *selected =3D NULL; +static struct audio_model *selected =3D NULL; static const char *audiodev_id; =20 -void select_soundhw(const char *name, const char *audiodev) +void audio_set_model(const char *name, const char *audiodev) { - struct soundhw *c; + struct audio_model *c; =20 if (selected) { error_report("only one -audio option is allowed"); exit(1); } =20 - for (c =3D soundhw; c->name; ++c) { + for (c =3D audio_models; c->name; ++c) { if (g_str_equal(c->name, name)) { selected =3D c; audiodev_id =3D audiodev; @@ -109,9 +109,9 @@ void select_soundhw(const char *name, const char *audio= dev) } } =20 -void soundhw_init(void) +void audio_model_init(void) { - struct soundhw *c =3D selected; + struct audio_model *c =3D selected; =20 if (!c) { return; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 8ea3a161a4..12a214c566 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "hw/isa/isa.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "qemu/module.h" #include "qemu/timer.h" diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index bac64118fe..0d9fa74108 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -1471,8 +1471,7 @@ static const TypeInfo sb16_info =3D { static void sb16_register_types (void) { type_register_static (&sb16_info); - deprecated_register_soundhw("sb16", "Creative Sound Blaster 16", - 1, TYPE_SB16); + audio_register_model("sb16", "Creative Sound Blaster 16", 1, TYPE_SB16= ); } =20 type_init (sb16_register_types) diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c index 9eb0007392..613538e46f 100644 --- a/hw/audio/virtio-snd-pci.c +++ b/hw/audio/virtio-snd-pci.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "qom/object.h" #include "qapi/error.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "hw/virtio/virtio-pci.h" #include "hw/audio/virtio-snd.h" =20 @@ -88,7 +88,7 @@ static int virtio_snd_pci_init(PCIBus *bus, const char *a= udiodev) static void virtio_snd_pci_register(void) { virtio_pci_types_register(&virtio_snd_pci_info); - pci_register_soundhw("virtio", "Virtio Sound", virtio_snd_pci_init); + audio_register_model_with_cb("virtio", "Virtio Sound", virtio_snd_pci_= init); } =20 type_init(virtio_snd_pci_register); diff --git a/system/vl.c b/system/vl.c index 7187b24449..9245ec986c 100644 --- a/system/vl.c +++ b/system/vl.c @@ -86,7 +86,7 @@ #include "migration/snapshot.h" #include "system/tpm.h" #include "system/dma.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "system/cpus.h" #include "system/cpu-timers.h" @@ -2731,7 +2731,7 @@ static void qemu_create_cli_devices(void) { DeviceOption *opt; =20 - soundhw_init(); + audio_model_init(); =20 qemu_opts_foreach(qemu_find_opts("fw_cfg"), parse_fw_cfg, fw_cfg_find(), &error_fatal); @@ -3087,7 +3087,7 @@ void qemu_init(int argc, char **argv) visit_free(v); if (model) { audio_add_audiodev(dev); - select_soundhw(model, dev->id); + audio_set_model(model, dev->id); g_free(model); } else { audio_add_default_audiodev(dev, &error_fatal); diff --git a/hw/audio/meson.build b/hw/audio/meson.build index 2990974449..2154cbdb57 100644 --- a/hw/audio/meson.build +++ b/hw/audio/meson.build @@ -1,4 +1,4 @@ -system_ss.add(files('soundhw.c')) +system_ss.add(files('model.c')) system_ss.add(when: 'CONFIG_AC97', if_true: files('ac97.c')) system_ss.add(when: 'CONFIG_ADLIB', if_true: files('fmopl.c', 'adlib.c')) system_ss.add(when: 'CONFIG_ASC', if_true: files('asc.c')) diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py index 4526268ae8..fe7354b473 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -264,7 +264,7 @@ def test_initial_includes(): #define SILENT_ES1370 =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" +#include "hw/audio/model.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037608; cv=none; d=zohomail.com; s=zohoarc; b=fcj4Ex8n9wCkgselCzGf5UiUVfUY5dOBtWORgJX5wyHgOTmyUWKYbBictb0DKGq+xvLZds6WEIQZ+VMPeugIhspyxpIi1CamCqnfG94tu144MbUCySAdDbAfohaQ2brU+EykxesfWjSexgBDVMkPNoLXelnEG6s+iWvL5owY3ZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037607; 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=GJHhV44xA2yV6Pwkj+xG4UfO7EkjL4EsvWC4IiZRDKY=; b=Sb5p2JoCztqia5pBZqlvng22qtdEP8HbOP/ZQnRQVU9HIyOkgYY8ci5OhfCGY/1cVWconjugH0YqouGpEs2MhLCLsCCEnmwNErZF5diM6BagC94CzAOVA2M8Bi6sXIUnNgI+6HGbT6rwBninuCdOx5OFosg0kcJz4bxoF/TpTU4= 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 1761037607882925.3674467036053; Tue, 21 Oct 2025 02:06:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8IK-0001Ug-JJ; Tue, 21 Oct 2025 05:04:40 -0400 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 1vB8IJ-0001UO-2s for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8IH-0003xp-9T for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:38 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-42-YmMuRcaaOJG_zpFk1KfFtw-1; Tue, 21 Oct 2025 05:04:31 -0400 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 17AAE1800C32; Tue, 21 Oct 2025 09:04:30 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E8ED180035A; Tue, 21 Oct 2025 09:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037476; 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=GJHhV44xA2yV6Pwkj+xG4UfO7EkjL4EsvWC4IiZRDKY=; b=RdSQAl+ob4jqYub54yfscubGBzpFlxpNbFvRcI77EGFrFAQEFPrMkUbBNRPqIVB3mX70HP Cdwf96gV/Du5DTI5UEIuCMXWPNn0BYnNhHKJUBmF+bbY8cU/o4i8SqSEpsex34aZuPK7C8 Anx0MEYJBf53KIZZRTiznz6jDwEkq5g= X-MC-Unique: YmMuRcaaOJG_zpFk1KfFtw-1 X-Mimecast-MFC-AGG-ID: YmMuRcaaOJG_zpFk1KfFtw_1761037470 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , Manos Pitsidianakis Subject: [PATCH 12/43] hw/audio/virtio-snd-pci: remove custom model callback Date: Tue, 21 Oct 2025 13:02:43 +0400 Message-ID: <20251021090317.425409-13-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037631804158500 From: Marc-Andr=C3=A9 Lureau virtio-snd can rely on the default code to instantiate the device and set the audiodev. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/audio/virtio-snd-pci.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c index 613538e46f..b78eaff851 100644 --- a/hw/audio/virtio-snd-pci.c +++ b/hw/audio/virtio-snd-pci.c @@ -71,24 +71,10 @@ static const VirtioPCIDeviceTypeInfo virtio_snd_pci_inf= o =3D { .class_init =3D virtio_snd_pci_class_init, }; =20 -/* Create a Virtio Sound PCI device, so '-audio driver,model=3Dvirtio' wor= ks. */ -static int virtio_snd_pci_init(PCIBus *bus, const char *audiodev) -{ - DeviceState *vdev =3D NULL; - VirtIOSoundPCI *dev =3D NULL; - - vdev =3D qdev_new(TYPE_VIRTIO_SND_PCI); - assert(vdev); - dev =3D VIRTIO_SND_PCI(vdev); - qdev_prop_set_string(DEVICE(&dev->vdev), "audiodev", audiodev); - qdev_realize_and_unref(vdev, BUS(bus), &error_fatal); - return 0; -} - static void virtio_snd_pci_register(void) { virtio_pci_types_register(&virtio_snd_pci_info); - audio_register_model_with_cb("virtio", "Virtio Sound", virtio_snd_pci_= init); + audio_register_model("virtio", "Virtio Sound", 0, TYPE_VIRTIO_SND_PCI); } =20 type_init(virtio_snd_pci_register); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037584; cv=none; d=zohomail.com; s=zohoarc; b=XXc4QPBzPphoFs0WTVQDU4t6soOoHwjUIGBkI0MVwu0ftfChJ9JQiIMlR1IJdibTC1kg0SDZsrwXGJsSHLgFgSMmbKpruayjAzmJne9GtZr7H/ZkHXOd+VxNYaXaYuyeXi5n6MoICVlJbS9KhUFCAa8vxBtQLor4GrYh2Gj6iXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037584; 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=rwpnWD9iw8bqt6SJCbIjLvqQbhMiOwHt9uoQCFJISgc=; b=e5/MAtJkLObaaYm/HhYO2MC8ExFMHHj6/VAl2B8U431zf4uKohfh2yxjNcfpGVc0bGdTVSiHQgfMXS1FJxuaTwdIgp87Tc9G1AzwPiTfJT/3M8vJlwIZiSZYzqi14gA4JZokV1hK5MNFwBzPL9mh8Ljm2wnx4BYplmiu4rxtMwE= 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 1761037584341563.5823473424726; Tue, 21 Oct 2025 02:06:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8IN-0001VW-TP; Tue, 21 Oct 2025 05:04:43 -0400 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 1vB8IL-0001VE-Ou for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:42 -0400 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 1vB8IK-0003y2-0E for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:41 -0400 Received: from mx-prod-mc-05.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-437-o4LayQD1OJWH26o8GdIWDQ-1; Tue, 21 Oct 2025 05:04:36 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D578219560A1; Tue, 21 Oct 2025 09:04:35 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 61B5819560A2; Tue, 21 Oct 2025 09:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037479; 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=rwpnWD9iw8bqt6SJCbIjLvqQbhMiOwHt9uoQCFJISgc=; b=dmzCi77Y1f/mXlUg9FjprNCpQBxZBlgKpkl+qSbEbaoInxI0YRScXBNH4NFYxzzLfXbZ6V HlvyO8gxfvRm5Wbp3gFCOHD0jietK8PNDjQhZOKdF5viqUB2vGR8agtmGWTzHQSmz4+J7l UVl3wwTh9yA7kBjVPgia998hrvF9bjo= X-MC-Unique: o4LayQD1OJWH26o8GdIWDQ-1 X-Mimecast-MFC-AGG-ID: o4LayQD1OJWH26o8GdIWDQ_1761037475 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 13/43] hw/audio: simplify 'hda' audio init code Date: Tue, 21 Oct 2025 13:02:44 +0400 Message-ID: <20251021090317.425409-14-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.12 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037593423158500 From: Marc-Andr=C3=A9 Lureau For consistency, use only qdev_device_add() to instantiate the devices. We can't rely on automatic bus lookup for the "hda-duplex" device though as it may end up on a different "intel-hda" bus... Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/audio/intel-hda.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 6a0db0dd9e..14bcf1257d 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -21,6 +21,7 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "hw/pci/msi.h" +#include "monitor/qdev.h" #include "qemu/timer.h" #include "qemu/bitops.h" #include "qemu/log.h" @@ -30,6 +31,7 @@ #include "intel-hda.h" #include "migration/vmstate.h" #include "intel-hda-defs.h" +#include "qobject/qdict.h" #include "system/dma.h" #include "qapi/error.h" #include "qom/object.h" @@ -1305,15 +1307,19 @@ static const TypeInfo hda_codec_device_type_info = =3D { */ static int intel_hda_and_codec_init(PCIBus *bus, const char *audiodev) { - DeviceState *controller; + g_autoptr(QDict) props =3D qdict_new(); + DeviceState *intel_hda, *codec; BusState *hdabus; - DeviceState *codec; =20 - controller =3D DEVICE(pci_create_simple(bus, -1, "intel-hda")); - hdabus =3D QLIST_FIRST(&controller->child_bus); + qdict_put_str(props, "driver", "intel-hda"); + intel_hda =3D qdev_device_add_from_qdict(props, false, &error_fatal); + hdabus =3D QLIST_FIRST(&intel_hda->child_bus); + codec =3D qdev_new("hda-duplex"); qdev_prop_set_string(codec, "audiodev", audiodev); qdev_realize_and_unref(codec, hdabus, &error_fatal); + object_unref(intel_hda); + return 0; } =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037846; cv=none; d=zohomail.com; s=zohoarc; b=m7EcC39FipAm+aUCaTREuCFmt3TAekJiVASmos71in1ktvt0r7TC8/WNXYRE5NosRY4LeTRJyU8kFbTl53HVU9eaVrxeiVrGCS0oRK/zaolACEViiAwnCJGppdZpyH1yFUUvF3Mo/jVVDEvTfEKfNk/m5GJz2rgzL02j9/WHgQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037846; 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=qO3UCF88r7wg/RiyvGpw9tTC25/Vsr3Q7lftN3svXyI=; b=BXjLBlOCtmbcRE7Nez1XW32PufLHSBtepAaAEiqNX2aU1lY/mwGSkxUvwhPTaenaA+QOIQ5PvGPQeEnYolpZrtfyIBf2dBCaqeInZg8injntkR/eiUv6yxf6BYBOTUCo8ehb9HCy6Bwy4Njt5Vu6GbvlxhM2xW2tgQEBXCiudxE= 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 1761037846785948.0421461872207; Tue, 21 Oct 2025 02:10:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8J1-0002lB-I8; Tue, 21 Oct 2025 05:05:23 -0400 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 1vB8Ip-0002L5-Kr for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:15 -0400 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 1vB8In-0004C2-Po for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:11 -0400 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-65-ZdxRAixOOWaefEhj_z2Mwg-1; Tue, 21 Oct 2025 05:04:42 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 56713195608F; Tue, 21 Oct 2025 09:04:41 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E78831955F22; Tue, 21 Oct 2025 09:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037508; 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=qO3UCF88r7wg/RiyvGpw9tTC25/Vsr3Q7lftN3svXyI=; b=hINhEH3b46VVeZu9Sp8gtJmGWRjCyT75hwKP0EgE/XnauJYUwglA1xaD9b+RO49+js3uiI Mjrn3ujnNkaW+Nn9jQk205N/Fm4M+l2VxGNLGo2VWYCmjnO1KiYZP2Imv8iq8hBzLr20ol 2sAJ2EebARB7cGfNpHaj0QnyyW/krOs= X-MC-Unique: ZdxRAixOOWaefEhj_z2Mwg-1 X-Mimecast-MFC-AGG-ID: ZdxRAixOOWaefEhj_z2Mwg_1761037481 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 14/43] hw/audio: generalize audio_model.init() Date: Tue, 21 Oct 2025 13:02:45 +0400 Message-ID: <20251021090317.425409-15-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037848566154100 From: Marc-Andr=C3=A9 Lureau It is no longer PCI bus only. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/audio/model.h | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/model.c | 12 ++++-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/hw/audio/model.h b/include/hw/audio/model.h index 27ae7dcc31..55d6ac7f6e 100644 --- a/include/hw/audio/model.h +++ b/include/hw/audio/model.h @@ -2,7 +2,7 @@ #define HW_AUDIO_MODEL_H =20 void audio_register_model_with_cb(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus, const char = *audiodev)); + int (*init_audio_model)(const char *audi= odev)); void audio_register_model(const char *name, const char *descr, int isa, const char *typename); =20 diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 14bcf1257d..0d35afa4ab 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -1305,7 +1305,7 @@ static const TypeInfo hda_codec_device_type_info =3D { * create intel hda controller with codec attached to it, * so '-soundhw hda' works. */ -static int intel_hda_and_codec_init(PCIBus *bus, const char *audiodev) +static int intel_hda_and_codec_init(const char *audiodev) { g_autoptr(QDict) props =3D qdict_new(); DeviceState *intel_hda, *codec; diff --git a/hw/audio/model.c b/hw/audio/model.c index 668349c69d..4f6a234159 100644 --- a/hw/audio/model.c +++ b/hw/audio/model.c @@ -24,14 +24,11 @@ #include "qemu/osdep.h" #include "hw/qdev-core.h" #include "monitor/qdev.h" -#include "qemu/option.h" -#include "qemu/help_option.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qom/object.h" #include "hw/qdev-properties.h" #include "hw/isa/isa.h" -#include "hw/pci/pci.h" #include "hw/audio/model.h" =20 struct audio_model { @@ -39,20 +36,20 @@ struct audio_model { const char *descr; const char *typename; int isa; - int (*init_pci) (PCIBus *bus, const char *audiodev); + int (*init)(const char *audiodev); }; =20 static struct audio_model audio_models[9]; static int audio_models_count; =20 void audio_register_model_with_cb(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus, const char = *audiodev)) + int (*init_audio_model)(const char *audi= odev)) { assert(audio_models_count < ARRAY_SIZE(audio_models) - 1); audio_models[audio_models_count].name =3D name; audio_models[audio_models_count].descr =3D descr; audio_models[audio_models_count].isa =3D 0; - audio_models[audio_models_count].init_pci =3D init_pci; + audio_models[audio_models_count].init =3D init_audio_model; audio_models_count++; } =20 @@ -124,7 +121,6 @@ void audio_model_init(void) qdev_realize_and_unref(dev, bus, &error_fatal); } else { assert(!c->isa); - PCIBus *pci_bus =3D (PCIBus *) object_resolve_path_type("", TYPE_P= CI_BUS, NULL); - c->init_pci(pci_bus, audiodev_id); + c->init(audiodev_id); } } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037547; cv=none; d=zohomail.com; s=zohoarc; b=RSMNAQsdC1+lItvd5ce9ucsl0svUuSDzDdG+Vk8hdkaL17fiCOXn4qWwQKf4um4IwLZMwHSJrxjrYlVy6kvAjrBoVpkEVppTO8aMMB2yYEFy6qa2e6jFvlMoKUwwzoajrjH/3zTjfRB9+rhjlssHnoNoKit2gwLEACKCp4nDZf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037547; 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=mwqZAO19swjAeOZ+xIDLvgyRQnidIjgaxUjdfCadzPM=; b=KRBUP4BhQZsAXI9NlNIbThMALPk/8mK7aUcbczEQN+/+vlv/dJu+uP6IB516suNtOb8+Uo5Da4weFjoZGahAtWPpHI/SjQ5M9r6RtgzTsD/vx1Ml/MYa3izwAct4sVyAogEdsLuE1l2kuSSzJqnypO1q88PSbpu483DbuGTyA/0= 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 1761037547819225.5663121096868; Tue, 21 Oct 2025 02:05:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ia-0001vi-Fl; Tue, 21 Oct 2025 05:04:56 -0400 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 1vB8IW-0001qD-Uz for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8IU-0003yk-PC for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:52 -0400 Received: from mx-prod-mc-05.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-354-PXFHkp80NYawM48JuEOy-g-1; Tue, 21 Oct 2025 05:04:47 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B76F1956089; Tue, 21 Oct 2025 09:04:46 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5330930001BE; Tue, 21 Oct 2025 09:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037489; 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=mwqZAO19swjAeOZ+xIDLvgyRQnidIjgaxUjdfCadzPM=; b=K5enT32/aN8/QqGjOHjDaUDqbIdAe1R/CmONJu4Wb9qXQlBj6bjLIWgr0ILv+jZi3zqZ3M oPLB9PWjqVzpEgg/BOJEt3Sy+yGOse3o29s3KSNVVzkQ5LLh4aKTGLWW2ZYCGUFE2WgS/G 64StqJleHlycDaMkN3x+SdAmUHJv/40= X-MC-Unique: PXFHkp80NYawM48JuEOy-g-1 X-Mimecast-MFC-AGG-ID: PXFHkp80NYawM48JuEOy-g_1761037486 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , "Michael S. Tsirkin" , Manos Pitsidianakis Subject: [PATCH 15/43] hw/audio: drop audio_model.isa Date: Tue, 21 Oct 2025 13:02:46 +0400 Message-ID: <20251021090317.425409-16-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037548815158500 From: Marc-Andr=C3=A9 Lureau That's no longer necessary, the code is bus-agnostic. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/audio/model.h | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/model.c | 7 +------ hw/audio/sb16.c | 2 +- hw/audio/virtio-snd-pci.c | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/hw/audio/model.h b/include/hw/audio/model.h index 55d6ac7f6e..ebe456c22f 100644 --- a/include/hw/audio/model.h +++ b/include/hw/audio/model.h @@ -4,7 +4,7 @@ void audio_register_model_with_cb(const char *name, const char *descr, int (*init_audio_model)(const char *audi= odev)); void audio_register_model(const char *name, const char *descr, - int isa, const char *typename); + const char *typename); =20 void audio_model_init(void); void audio_print_available_models(void); diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 2e1be5089e..3d3c667e86 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1360,7 +1360,7 @@ static const TypeInfo ac97_info =3D { static void ac97_register_types(void) { type_register_static(&ac97_info); - audio_register_model("ac97", "Intel 82801AA AC97 Audio", 0, TYPE_AC97); + audio_register_model("ac97", "Intel 82801AA AC97 Audio", TYPE_AC97); } =20 type_init(ac97_register_types) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index a7c2efd87c..0bc0359ae6 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -323,7 +323,7 @@ static const TypeInfo adlib_info =3D { static void adlib_register_types (void) { type_register_static (&adlib_info); - audio_register_model("adlib", ADLIB_DESC, 1, TYPE_ADLIB); + audio_register_model("adlib", ADLIB_DESC, TYPE_ADLIB); } =20 type_init (adlib_register_types) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 1f7e0a33c0..18db8da324 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -723,7 +723,7 @@ static const TypeInfo cs4231a_info =3D { static void cs4231a_register_types (void) { type_register_static (&cs4231a_info); - audio_register_model("cs4231a", "CS4231A", 1, TYPE_CS4231A); + audio_register_model("cs4231a", "CS4231A", TYPE_CS4231A); } =20 type_init (cs4231a_register_types) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 913c9022f6..8cb47589c3 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -905,7 +905,7 @@ static const TypeInfo es1370_info =3D { static void es1370_register_types (void) { type_register_static (&es1370_info); - audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", 0, TYPE_ES13= 70); + audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", TYPE_ES1370); } =20 type_init (es1370_register_types) diff --git a/hw/audio/gus.c b/hw/audio/gus.c index ac9332ea3d..16785ce226 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -319,7 +319,7 @@ static const TypeInfo gus_info =3D { static void gus_register_types (void) { type_register_static (&gus_info); - audio_register_model("gus", "Gravis Ultrasound GF1", 1, TYPE_GUS); + audio_register_model("gus", "Gravis Ultrasound GF1", TYPE_GUS); } =20 type_init (gus_register_types) diff --git a/hw/audio/model.c b/hw/audio/model.c index 4f6a234159..924a41e0ac 100644 --- a/hw/audio/model.c +++ b/hw/audio/model.c @@ -28,14 +28,12 @@ #include "qapi/error.h" #include "qom/object.h" #include "hw/qdev-properties.h" -#include "hw/isa/isa.h" #include "hw/audio/model.h" =20 struct audio_model { const char *name; const char *descr; const char *typename; - int isa; int (*init)(const char *audiodev); }; =20 @@ -48,18 +46,16 @@ void audio_register_model_with_cb(const char *name, con= st char *descr, assert(audio_models_count < ARRAY_SIZE(audio_models) - 1); audio_models[audio_models_count].name =3D name; audio_models[audio_models_count].descr =3D descr; - audio_models[audio_models_count].isa =3D 0; audio_models[audio_models_count].init =3D init_audio_model; audio_models_count++; } =20 void audio_register_model(const char *name, const char *descr, - int isa, const char *typename) + const char *typename) { assert(audio_models_count < ARRAY_SIZE(audio_models) - 1); audio_models[audio_models_count].name =3D name; audio_models[audio_models_count].descr =3D descr; - audio_models[audio_models_count].isa =3D isa; audio_models[audio_models_count].typename =3D typename; audio_models_count++; } @@ -120,7 +116,6 @@ void audio_model_init(void) qdev_prop_set_string(dev, "audiodev", audiodev_id); qdev_realize_and_unref(dev, bus, &error_fatal); } else { - assert(!c->isa); c->init(audiodev_id); } } diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 0d9fa74108..cd7e813d05 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1471,7 +1471,7 @@ static const TypeInfo sb16_info =3D { static void sb16_register_types (void) { type_register_static (&sb16_info); - audio_register_model("sb16", "Creative Sound Blaster 16", 1, TYPE_SB16= ); + audio_register_model("sb16", "Creative Sound Blaster 16", TYPE_SB16); } =20 type_init (sb16_register_types) diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c index b78eaff851..230581ed63 100644 --- a/hw/audio/virtio-snd-pci.c +++ b/hw/audio/virtio-snd-pci.c @@ -74,7 +74,7 @@ static const VirtioPCIDeviceTypeInfo virtio_snd_pci_info = =3D { static void virtio_snd_pci_register(void) { virtio_pci_types_register(&virtio_snd_pci_info); - audio_register_model("virtio", "Virtio Sound", 0, TYPE_VIRTIO_SND_PCI); + audio_register_model("virtio", "Virtio Sound", TYPE_VIRTIO_SND_PCI); } =20 type_init(virtio_snd_pci_register); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037589; cv=none; d=zohomail.com; s=zohoarc; b=Hjyu1FngA7FZRMAYJsNScLWswcOYjgRS6wgGAcPxgoh3rZm9j1R8ErhDmiUeFWcpBNhg/BKhrCBMKajXRc18HmFcqzAH/hW3D7fj6RFbhOwoNduyezfFeKqH165vr5JoDtO3U0OPYZ/njDctxJkptRRN02HmuKMsejlWBV0IEoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037589; 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=ONL0APN3lxSe1Dm84qOKL5byWQonsh+vmwtQz2dCb00=; b=jykalhMKQfgTT5DoodXfFXUPZh4AOmUDtgyuNdS+DgfWfiP0VkeH/WaGIrlKoGK9DJghjqcdokPvsWSgwnS6AlBE+nKQgR/FzNb4+9uEKycCkV260aHMzWkEAL845GYA3ti8xuIGaymrsrejQbtaOdrbjTO7eO5E2qUsEk7lUNo= 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 1761037589756682.9675780093837; Tue, 21 Oct 2025 02:06:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ii-0002Am-JA; Tue, 21 Oct 2025 05:05:06 -0400 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 1vB8Id-00022W-FB for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Ib-0003zC-C8 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:04:59 -0400 Received: from mx-prod-mc-04.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-70-irEOgllXOiWjYIT4QJkDkA-1; Tue, 21 Oct 2025 05:04:53 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 03646195422B; Tue, 21 Oct 2025 09:04:52 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9B48819560A2; Tue, 21 Oct 2025 09:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037496; 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=ONL0APN3lxSe1Dm84qOKL5byWQonsh+vmwtQz2dCb00=; b=W/faQ7di5mfvPVakKdnFw0Z8/zy1ytNVkSUvR5aiTZTYS+MLW2Vnu70dvE4dA/hWcGkCMZ JS5f7mblYEr8/kBFW2oLITdi/2byO0a46tF9Soe63sPCV29kBOw1iNgUqY7ElzKK+B11+Y 9G5h3/aayx/uGHaRXf+vz5+3JG/qv78= X-MC-Unique: irEOgllXOiWjYIT4QJkDkA-1 X-Mimecast-MFC-AGG-ID: irEOgllXOiWjYIT4QJkDkA_1761037492 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 16/43] audio: start making AudioState a QOM Object Date: Tue, 21 Oct 2025 13:02:47 +0400 Message-ID: <20251021090317.425409-17-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.12 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037591895154100 From: Marc-Andr=C3=A9 Lureau QOM brings some conveniences for introspection, type checking, reference counting, interfaces etc. This is only the first step to introduce QOM in audio/ (I have more in the pipeline) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- audio/audio.h | 8 ++++++++ audio/audio_int.h | 2 ++ audio/audio.c | 43 ++++++++++++++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index eb5b5d662d..f56a8c8baf 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -80,6 +80,11 @@ typedef struct SWVoiceOut SWVoiceOut; typedef struct CaptureVoiceOut CaptureVoiceOut; typedef struct SWVoiceIn SWVoiceIn; =20 +typedef struct AudioStateClass AudioStateClass; +struct AudioStateClass { + ObjectClass parent_class; +}; + typedef struct AudioState AudioState; typedef struct QEMUSoundCard { char *name; @@ -182,4 +187,7 @@ const char *audio_get_id(QEMUSoundCard *card); #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) =20 +#define TYPE_AUDIO_STATE "audio-state" +OBJECT_DECLARE_TYPE(AudioState, AudioStateClass, AUDIO_STATE) + #endif /* QEMU_AUDIO_H */ diff --git a/audio/audio_int.h b/audio/audio_int.h index f78ca05f92..b2b4d2d10e 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -217,6 +217,8 @@ struct SWVoiceCap { }; =20 typedef struct AudioState { + Object parent; + struct audio_driver *drv; Audiodev *dev; void *drv_opaque; diff --git a/audio/audio.c b/audio/audio.c index 6197fa1788..754952ce58 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1617,8 +1617,19 @@ static void audio_vm_change_state_handler (void *opa= que, bool running, audio_reset_timer (s); } =20 -static void free_audio_state(AudioState *s) +static void audio_state_init(Object *obj) { + AudioState *s =3D AUDIO_STATE(obj); + + QLIST_INIT (&s->hw_head_out); + QLIST_INIT (&s->hw_head_in); + QLIST_INIT (&s->cap_head); + s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); +} + +static void audio_state_finalize(Object *obj) +{ + AudioState *s =3D AUDIO_STATE(obj); HWVoiceOut *hwo, *hwon; HWVoiceIn *hwi, *hwin; =20 @@ -1663,8 +1674,6 @@ static void free_audio_state(AudioState *s) timer_free(s->ts); s->ts =3D NULL; } - - g_free(s); } =20 void audio_cleanup(void) @@ -1673,7 +1682,7 @@ void audio_cleanup(void) while (!QTAILQ_EMPTY(&audio_states)) { AudioState *s =3D QTAILQ_FIRST(&audio_states); QTAILQ_REMOVE(&audio_states, s, list); - free_audio_state(s); + object_unref(s); } } =20 @@ -1732,18 +1741,13 @@ static AudioState *audio_init(Audiodev *dev, Error = **errp) AudioState *s; struct audio_driver *driver; =20 - s =3D g_new0(AudioState, 1); + s =3D AUDIO_STATE(object_new(TYPE_AUDIO_STATE)); =20 - QLIST_INIT (&s->hw_head_out); - QLIST_INIT (&s->hw_head_in); - QLIST_INIT (&s->cap_head); if (!atexit_registered) { atexit(audio_cleanup); atexit_registered =3D true; } =20 - s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); - if (dev) { /* -audiodev option */ s->dev =3D dev; @@ -1796,7 +1800,7 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) return s; =20 out: - free_audio_state(s); + object_unref(s); return NULL; } =20 @@ -2320,3 +2324,20 @@ AudiodevList *qmp_query_audiodevs(Error **errp) } return ret; } + +static const TypeInfo audio_state_info =3D { + .name =3D TYPE_AUDIO_STATE, + .parent =3D TYPE_OBJECT, + .instance_size =3D sizeof(AudioState), + .instance_init =3D audio_state_init, + .instance_finalize =3D audio_state_finalize, + .abstract =3D false, // todo, subclass and make it abstract + .class_size =3D sizeof(AudioStateClass), +}; + +static void register_types(void) +{ + type_register_static(&audio_state_info); +} + +type_init(register_types); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037531; cv=none; d=zohomail.com; s=zohoarc; b=d1XR6E7hMsypPxx58NJ0w4hT/r5ez0SIO7UNQd7G3g8uHmDisO38jeVx40vnVbf2YxikSmwEMYc67A9F942nVMWv1oM+idHMxknCYUqWhPtzJxZ0jmDsT27QwqKckaLfTrB8PJ09W31fjTch0nn544Dhq6gS2ReWrmAcyuLh700= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037531; 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=edCqxjm6+it+f/NsFNu07UOMBwGQMYEzCgffa4wotb8=; b=bJ4ygjFPzfme6fobcdG/rHp15iTMzdDOedoC9eojG/JZZMprjEpjZLtixMsvV06YCQXE6VRdHMhDUaZBADEysp9dug6AccxZOQek/5Jif31ZGzDEGsbo8aGaZxtC7Gr0BYsVbHO6jBhSfwNqyj3gTzyMFyc/PjUwROAkTCDMDvQ= 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 1761037531224247.37297549792925; Tue, 21 Oct 2025 02:05:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Iv-0002Lk-TD; Tue, 21 Oct 2025 05:05:18 -0400 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 1vB8Ij-0002G4-VD for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:06 -0400 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 1vB8Ii-00043E-4j for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:05 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-nzzETLJiNqGnbY-9I7__8Q-1; Tue, 21 Oct 2025 05:04:58 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 809101800654; Tue, 21 Oct 2025 09:04:57 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F2570180057C; Tue, 21 Oct 2025 09:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037503; 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=edCqxjm6+it+f/NsFNu07UOMBwGQMYEzCgffa4wotb8=; b=iVJa2vP6jfiPQBLbNc0H5UtbMXV1qMq7LWivr7Sra3cBAp7vOneWpKGEwHzuuGWVxng7OA Eb7UglXqPs2ga8QfJx0GHIUP8QUTZetM3r4+0YDxFckXL0hn3oJiWGOJuiV6Ox/GoVCR6G LLM0hfzwTo2wbeFAmxoNc7VB2JLs2H4= X-MC-Unique: nzzETLJiNqGnbY-9I7__8Q-1 X-Mimecast-MFC-AGG-ID: nzzETLJiNqGnbY-9I7__8Q_1761037497 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 17/43] audio: register backends in /audiodevs container Date: Tue, 21 Oct 2025 13:02:48 +0400 Message-ID: <20251021090317.425409-18-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037533207154100 From: Marc-Andr=C3=A9 Lureau QOM tree now has /audiodevs objects. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- audio/audio.c | 8 ++++++++ qom/object.c | 1 + 2 files changed, 9 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 754952ce58..4714ed0b9f 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1726,6 +1726,11 @@ void audio_create_default_audiodevs(void) } } =20 +static Object *get_audiodevs_root(void) +{ + return object_get_container("audiodevs"); +} + /* * if we have dev, this function was called because of an -audiodev argume= nt =3D> * initialize a new state with it @@ -1742,6 +1747,9 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) struct audio_driver *driver; =20 s =3D AUDIO_STATE(object_new(TYPE_AUDIO_STATE)); + if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJE= CT(s), errp)) { + goto out; + } =20 if (!atexit_registered) { atexit(audio_cleanup); diff --git a/qom/object.c b/qom/object.c index 1856bb36c7..4f32c1aba7 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1730,6 +1730,7 @@ const char *object_property_get_type(Object *obj, con= st char *name, Error **errp } =20 static const char *const root_containers[] =3D { + "audiodevs", "chardevs", "objects", "backend" --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037676; cv=none; d=zohomail.com; s=zohoarc; b=HqR/IrIgd6XvundfPbvJTtNmCcHvNW0NW4bHqoAosDQNeB2srbu9xwejacs9swOGfYrtdPzPUSSQ+DaPrn/xHPvsBfdhECBhANmTYDWSkhrsEB6YQwULCp0ObSA5cfLwYpZLA6JlD9kESSxFoTirlXgCowtekmKUPJ72RnWtEtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037676; 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=FLEI5r8xSCcIi/mpDWX2V2kYmxCGJyy1gpArtFcbbmg=; b=FmoVx+MXODeIRHlkt0vswtLhnyAHRRpFKE7dY1Glzs9h7RbrOs7nhctvFLWOP+ZIz0kstmkcKfpplHLMjnI3OhplI02DPOE+VjCJBKHDj41wakcgYq37wsYEc5HZ4lFjmK4fwzPLw8MpC8MOfr6xjN1dorE0o9OjOiy24QNzDk0= 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 1761037676853126.68907022235896; Tue, 21 Oct 2025 02:07:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Iy-0002WD-U5; Tue, 21 Oct 2025 05:05:20 -0400 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 1vB8In-0002Kx-W9 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:12 -0400 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 1vB8Il-0004Bb-MC for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:09 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-YX_KUfNWN7i0rhFzBbaJog-1; Tue, 21 Oct 2025 05:05:03 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A3D718001D1; Tue, 21 Oct 2025 09:05:02 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 90BBE180057C; Tue, 21 Oct 2025 09:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037506; 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=FLEI5r8xSCcIi/mpDWX2V2kYmxCGJyy1gpArtFcbbmg=; b=IqjrnzOon+K/z50rTVhsH3MQDOjousw5uyWofraXs3NeXUHaB9tldboVAFo32kZmNFTeFY QKJhtFF2tfmmHVHvwUeTS1u1EFyfyGerWle7nopaiH973qkDMcfXEf9i96JLB6Pq1j6tIl Rn7zNjoP9pRKqlmU7r0YBogmzURlDvY= X-MC-Unique: YX_KUfNWN7i0rhFzBbaJog-1 X-Mimecast-MFC-AGG-ID: YX_KUfNWN7i0rhFzBbaJog_1761037502 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 18/43] audio: use /audiodevs qom container Date: Tue, 21 Oct 2025 13:02:49 +0400 Message-ID: <20251021090317.425409-19-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037688589158500 From: Marc-Andr=C3=A9 Lureau audio_cleanup() is already called at exit (similar to chardev) Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 2 -- audio/audio.c | 48 ++++++++++++++++++----------------------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index b2b4d2d10e..4187a2dbfc 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -235,8 +235,6 @@ typedef struct AudioState { =20 bool timer_running; uint64_t timer_last; - - QTAILQ_ENTRY(AudioState) list; } AudioState; =20 extern const struct mixeng_volume nominal_volume; diff --git a/audio/audio.c b/audio/audio.c index 4714ed0b9f..3af5f2670b 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -102,8 +102,6 @@ static audio_driver *audio_driver_lookup(const char *na= me) return NULL; } =20 -static QTAILQ_HEAD(AudioStateHead, AudioState) audio_states =3D - QTAILQ_HEAD_INITIALIZER(audio_states); static AudioState *default_audio_state; =20 const struct mixeng_volume nominal_volume =3D { @@ -1676,14 +1674,16 @@ static void audio_state_finalize(Object *obj) } } =20 +static Object *get_audiodevs_root(void) +{ + return object_get_container("audiodevs"); +} + void audio_cleanup(void) { default_audio_state =3D NULL; - while (!QTAILQ_EMPTY(&audio_states)) { - AudioState *s =3D QTAILQ_FIRST(&audio_states); - QTAILQ_REMOVE(&audio_states, s, list); - object_unref(s); - } + + object_unparent(get_audiodevs_root()); } =20 static bool vmstate_audio_needed(void *opaque) @@ -1726,11 +1726,6 @@ void audio_create_default_audiodevs(void) } } =20 -static Object *get_audiodevs_root(void) -{ - return object_get_container("audiodevs"); -} - /* * if we have dev, this function was called because of an -audiodev argume= nt =3D> * initialize a new state with it @@ -1739,7 +1734,6 @@ static Object *get_audiodevs_root(void) */ static AudioState *audio_init(Audiodev *dev, Error **errp) { - static bool atexit_registered; int done =3D 0; const char *drvname; VMChangeStateEntry *vmse; @@ -1747,14 +1741,6 @@ static AudioState *audio_init(Audiodev *dev, Error *= *errp) struct audio_driver *driver; =20 s =3D AUDIO_STATE(object_new(TYPE_AUDIO_STATE)); - if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJE= CT(s), errp)) { - goto out; - } - - if (!atexit_registered) { - atexit(audio_cleanup); - atexit_registered =3D true; - } =20 if (dev) { /* -audiodev option */ @@ -1802,7 +1788,10 @@ static AudioState *audio_init(Audiodev *dev, Error *= *errp) "(Audio can continue looping even after stopping the VM)\n"= ); } =20 - QTAILQ_INSERT_TAIL(&audio_states, s, list); + if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJE= CT(s), errp)) { + goto out; + } + object_unref(s); QLIST_INIT (&s->card_head); vmstate_register_any(NULL, &vmstate_audio, s); return s; @@ -2249,15 +2238,14 @@ int audio_buffer_bytes(AudiodevPerDirectionOptions = *pdo, =20 AudioState *audio_state_by_name(const char *name, Error **errp) { - AudioState *s; - QTAILQ_FOREACH(s, &audio_states, list) { - assert(s->dev); - if (strcmp(name, s->dev->id) =3D=3D 0) { - return s; - } + Object *obj =3D object_resolve_path_component(get_audiodevs_root(), na= me); + + if (!obj) { + error_setg(errp, "audiodev '%s' not found", name); + return NULL; + } else { + return AUDIO_STATE(obj); } - error_setg(errp, "audiodev '%s' not found", name); - return NULL; } =20 const char *audio_get_id(QEMUSoundCard *card) --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037846; cv=none; d=zohomail.com; s=zohoarc; b=hKQ8am3L8WIZq5wBJZ9X81fcGuZxz49NeEALOsJLR3tkjZTzsiNppvKf+DgVIIto5QxdI6bvHoqHHR90h4eb4haSX4izI9ViqfWWZCY0eZJ6r9XZ0ZlmzKfmy5LWNZeirMMokrw0QB/8ZxAArcT+5BUuWnTWVfSIz+qxDt/2VZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037846; 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=gI1QAW8znPF68gfbqfS6bjSoZLHpqR0NqAR5uP2/jK8=; b=HkCKD06opYMafMdN3XP3lNkgogu+mbAa2NaDcC81kOXan8b1xU0VKZhC5MhJ+ryn5YHIiHpr1xXne/bazR8E3W68kk2nqTUldWl1Ygx1ifGvjoRmrBqid9ERPZ/oel0X+X2IxKwErg/PeX9GUoYUY9SGA9ViNC16VJHX5fNjsho= 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 1761037846078275.6920696053844; Tue, 21 Oct 2025 02:10:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8J3-0002y3-FS; Tue, 21 Oct 2025 05:05:25 -0400 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 1vB8Ir-0002LX-OF for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Ip-0004CL-GO for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:13 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-Hxwmnp8yPbiKG8j-8vRHQg-1; Tue, 21 Oct 2025 05:05:09 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0DC531800743; Tue, 21 Oct 2025 09:05:08 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 85E3D30001BE; Tue, 21 Oct 2025 09:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037510; 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=gI1QAW8znPF68gfbqfS6bjSoZLHpqR0NqAR5uP2/jK8=; b=EYya/NE/0rPo3s/xe8IaG5/kN3QVuVQuhY99tfvLaDqL5qLZb1XPhQIHzQJtRNydeccqeS ct4oDSBuIL6B1StsxMZ+sRnFikC3Yv24rhc3op+16edORkj7r3FLWjcMy3HU/OEWbPtzoa 2iOKOEMfIG8f9RRyc/dvyTHGy0tkDVA= X-MC-Unique: Hxwmnp8yPbiKG8j-8vRHQg-1 X-Mimecast-MFC-AGG-ID: Hxwmnp8yPbiKG8j-8vRHQg_1761037508 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 19/43] audio/paaudio: remove needless return value Date: Tue, 21 Oct 2025 13:02:50 +0400 Message-ID: <20251021090317.425409-20-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037848524154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- audio/paaudio.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index f3193b08c3..93030f3fc8 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -747,14 +747,13 @@ static void qpa_volume_in(HWVoiceIn *hw, Volume *vol) pa_threaded_mainloop_unlock(c->mainloop); } =20 -static int qpa_validate_per_direction_opts(Audiodev *dev, - AudiodevPaPerDirectionOptions *= pdo) +static void qpa_validate_per_direction_opts(Audiodev *dev, + AudiodevPaPerDirectionOptions = *pdo) { if (!pdo->has_latency) { pdo->has_latency =3D true; pdo->latency =3D 46440; } - return 1; } =20 /* common */ @@ -844,12 +843,8 @@ static void *qpa_audio_init(Audiodev *dev, Error **err= p) } } =20 - if (!qpa_validate_per_direction_opts(dev, popts->in)) { - return NULL; - } - if (!qpa_validate_per_direction_opts(dev, popts->out)) { - return NULL; - } + qpa_validate_per_direction_opts(dev, popts->in); + qpa_validate_per_direction_opts(dev, popts->out); =20 g =3D g_new0(paaudio, 1); server =3D popts->server; --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037641; cv=none; d=zohomail.com; s=zohoarc; b=mzBV8VET+w35qM0kZK4kZSuyAXlROjPbSVD+dysDe/meFuf7bq2fdE8R/MhKV10SM73GZ/wYVc/3jzKP2d/s/nVJ5B0o+diOXkSEw9Tq+wIsv++rVvOiYtHs1v/YLCV5IcSv2ZPeH56QM2vhAuIfp2SCUacA5CBkNdt1fAy83OE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037641; 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=T5DGuhfLFoc7PT62ZhKWesCEDaDqaTP9IZTqxum1alU=; b=DTEcNv9yYGKP3xbL8SKhP4gJPf/BTYRsg6x01KHxnsxA+Ft6ngYBoz/KdarKfyVkZ6mYOZAgZPvMlx847MiosTtqQg+9J/hApfQ2xmaME6OCV5akSKDOOMPeH/rSfIxNPDEYOawsamZ41Tl2y2so6kzxkLwh3HwkVIxzyH4dToE= 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 1761037641342895.0025716594504; Tue, 21 Oct 2025 02:07:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8J6-00037s-Ke; Tue, 21 Oct 2025 05:05:28 -0400 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 1vB8J4-000330-MS for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:26 -0400 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 1vB8Ix-0004Dh-ID for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:26 -0400 Received: from mx-prod-mc-02.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-629-JPC7Dc8LMGW6s6BzGREGpg-1; Tue, 21 Oct 2025 05:05:14 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60F5C1956086; Tue, 21 Oct 2025 09:05:13 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 059FD19541B2; Tue, 21 Oct 2025 09:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037518; 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=T5DGuhfLFoc7PT62ZhKWesCEDaDqaTP9IZTqxum1alU=; b=LdRn//DtKvv3FaiWhuKI7ERsV/80TgcIQMGnhFq0LSdAqDQd8h89Zb7OfZSj11ITH/Yy9X UGdkq4ZktYf4gdbZWxvTrlkmL3wSvf8PLFIA9pcxaD8jhoACnduIE7OMWdNGHleKHGWAqp +WSIX/yFxHmR6VRpPkT36+hHmKiR8yA= X-MC-Unique: JPC7Dc8LMGW6s6BzGREGpg-1 X-Mimecast-MFC-AGG-ID: JPC7Dc8LMGW6s6BzGREGpg_1761037513 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 20/43] audio/dsound: simplify init() Date: Tue, 21 Oct 2025 13:02:51 +0400 Message-ID: <20251021090317.425409-21-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037649990158500 From: Marc-Andr=C3=A9 Lureau Use dsound_audio_fini() on error & fail if the capture failed to initialize too. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/dsoundaudio.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index f3bb48d007..d54d79d41c 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -638,7 +638,7 @@ static void *dsound_audio_init(Audiodev *dev, Error **e= rrp) hr =3D CoInitialize (NULL); if (FAILED (hr)) { dsound_logerr (hr, "Could not initialize COM\n"); - g_free(s); + dsound_audio_fini(s); return NULL; } =20 @@ -651,19 +651,14 @@ static void *dsound_audio_init(Audiodev *dev, Error *= *errp) ); if (FAILED (hr)) { dsound_logerr (hr, "Could not create DirectSound instance\n"); - g_free(s); + dsound_audio_fini(s); return NULL; } =20 hr =3D IDirectSound_Initialize (s->dsound, NULL); if (FAILED (hr)) { dsound_logerr (hr, "Could not initialize DirectSound\n"); - - hr =3D IDirectSound_Release (s->dsound); - if (FAILED (hr)) { - dsound_logerr (hr, "Could not release DirectSound\n"); - } - g_free(s); + dsound_audio_fini(s); return NULL; } =20 @@ -676,17 +671,15 @@ static void *dsound_audio_init(Audiodev *dev, Error *= *errp) ); if (FAILED (hr)) { dsound_logerr (hr, "Could not create DirectSoundCapture instance\n= "); - } else { - hr =3D IDirectSoundCapture_Initialize (s->dsound_capture, NULL); - if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize DirectSoundCapture\n"= ); + dsound_audio_fini(s); + return NULL; + } =20 - hr =3D IDirectSoundCapture_Release (s->dsound_capture); - if (FAILED (hr)) { - dsound_logerr (hr, "Could not release DirectSoundCapture\n= "); - } - s->dsound_capture =3D NULL; - } + hr =3D IDirectSoundCapture_Initialize (s->dsound_capture, NULL); + if (FAILED (hr)) { + dsound_logerr (hr, "Could not initialize DirectSoundCapture\n"); + dsound_audio_fini(s); + return NULL; } =20 err =3D dsound_set_cooperative_level(s); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037549; cv=none; d=zohomail.com; s=zohoarc; b=lwGFWNR7fFWVPoNyc2zaYjiY04hEcqQWoRZlNJKOUgOqzxZ2Qo9eyevo7vS/kZAV66ju4qVcOrK/zeC8jyOIdnBQB172+QjIihaTmn0gIggtHWazJbI2pbxu1p9DpyeLML+OpDT59X0L2bBinIwgl2ao56aTBnu6HRctbwowwMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037549; 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=qkzbrmyTwzsUPm+IgyKPZIwl+rvV+nRn9814G1hr6PQ=; b=npa1NzlvvXCrrOjW3J+Z9j3FsCqZCt1+dc7VT2OZF8N61bZbRmNEzQ0NVxBnMwFoKfeZ2ErzReBL0UFoJj1WIZ0L2IIkXWuWzpW5mJVIWG2iHcnTQSG4VGhB58QKpgmGQGvLOaLtWZviWHr/NePyF8gd3EJDvN5BIEuDesXjYW8= 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 1761037549561671.4377828149151; Tue, 21 Oct 2025 02:05:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8JB-0003Jn-7a; Tue, 21 Oct 2025 05:05:33 -0400 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 1vB8J9-0003Fn-47 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8J2-0004Dt-Gz for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:30 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-gGoEjpYaO9GRUZkj7bN2HA-1; Tue, 21 Oct 2025 05:05:19 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C6301800592; Tue, 21 Oct 2025 09:05:18 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 736BE3000218; Tue, 21 Oct 2025 09:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037523; 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=qkzbrmyTwzsUPm+IgyKPZIwl+rvV+nRn9814G1hr6PQ=; b=ZIbzYNS3iAtdzBOA9KmTu40aCJGedKWfByiuiAVW6qK85fw8XJplpby4TPlic2riCEff0k t+nskJRAVQC8YUTq+1stACxugzsDrdOvpQX+ePHJyWtY44jAZ1n+MebbpLGIKys2k+6/y/ FKTolxWlLHR6PO/0txwbYMTryF5nCkg= X-MC-Unique: gGoEjpYaO9GRUZkj7bN2HA-1 X-Mimecast-MFC-AGG-ID: gGoEjpYaO9GRUZkj7bN2HA_1761037518 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 21/43] audio/dsound: report init error via **errp Date: Tue, 21 Oct 2025 13:02:52 +0400 Message-ID: <20251021090317.425409-22-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037559082158500 From: Marc-Andr=C3=A9 Lureau Whenever NULL is returned, errp should be set. Inline SetCooperativeLevel call to simplify code. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/dsoundaudio.c | 182 +++++++++++++++++++------------------------- 1 file changed, 79 insertions(+), 103 deletions(-) diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index d54d79d41c..6a8b7f1a19 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -33,6 +33,7 @@ #include "audio_int.h" #include "qemu/host-utils.h" #include "qemu/module.h" +#include "qapi/error.h" =20 #include #include @@ -64,162 +65,154 @@ typedef struct { dsound *s; } DSoundVoiceIn; =20 -static void dsound_log_hresult (HRESULT hr) +static const char *dserror (HRESULT hr) { - const char *str =3D "BUG"; - switch (hr) { case DS_OK: - str =3D "The method succeeded"; - break; + return "The method succeeded"; #ifdef DS_NO_VIRTUALIZATION case DS_NO_VIRTUALIZATION: - str =3D "The buffer was created, but another 3D algorithm was subs= tituted"; - break; + return "The buffer was created, but another 3D algorithm was subst= ituted"; #endif #ifdef DS_INCOMPLETE case DS_INCOMPLETE: - str =3D "The method succeeded, but not all the optional effects we= re obtained"; - break; + return "The method succeeded, but not all the optional effects wer= e obtained"; #endif #ifdef DSERR_ACCESSDENIED case DSERR_ACCESSDENIED: - str =3D "The request failed because access was denied"; - break; + return "The request failed because access was denied"; #endif #ifdef DSERR_ALLOCATED case DSERR_ALLOCATED: - str =3D "The request failed because resources, " - "such as a priority level, were already in use " - "by another caller"; - break; + return "The request failed because resources, " + "such as a priority level, were already in use " + "by another caller"; #endif #ifdef DSERR_ALREADYINITIALIZED case DSERR_ALREADYINITIALIZED: - str =3D "The object is already initialized"; - break; + return "The object is already initialized"; #endif #ifdef DSERR_BADFORMAT case DSERR_BADFORMAT: - str =3D "The specified wave format is not supported"; - break; + return "The specified wave format is not supported"; #endif #ifdef DSERR_BADSENDBUFFERGUID case DSERR_BADSENDBUFFERGUID: - str =3D "The GUID specified in an audiopath file " - "does not match a valid mix-in buffer"; - break; + return "The GUID specified in an audiopath file " + "does not match a valid mix-in buffer"; #endif #ifdef DSERR_BUFFERLOST case DSERR_BUFFERLOST: - str =3D "The buffer memory has been lost and must be restored"; - break; + return "The buffer memory has been lost and must be restored"; #endif #ifdef DSERR_BUFFERTOOSMALL case DSERR_BUFFERTOOSMALL: - str =3D "The buffer size is not great enough to " - "enable effects processing"; - break; + return "The buffer size is not great enough to " + "enable effects processing"; #endif #ifdef DSERR_CONTROLUNAVAIL case DSERR_CONTROLUNAVAIL: - str =3D "The buffer control (volume, pan, and so on) " - "requested by the caller is not available. " - "Controls must be specified when the buffer is created, " - "using the dwFlags member of DSBUFFERDESC"; - break; + return "The buffer control (volume, pan, and so on) " + "requested by the caller is not available. " + "Controls must be specified when the buffer is created, " + "using the dwFlags member of DSBUFFERDESC"; #endif #ifdef DSERR_DS8_REQUIRED case DSERR_DS8_REQUIRED: - str =3D "A DirectSound object of class CLSID_DirectSound8 or later= " - "is required for the requested functionality. " - "For more information, see IDirectSound8 Interface"; - break; + return "A DirectSound object of class CLSID_DirectSound8 or later " + "is required for the requested functionality. " + "For more information, see IDirectSound8 Interface"; #endif #ifdef DSERR_FXUNAVAILABLE case DSERR_FXUNAVAILABLE: - str =3D "The effects requested could not be found on the system, " - "or they are in the wrong order or in the wrong location; " - "for example, an effect expected in hardware " - "was found in software"; - break; + return "The effects requested could not be found on the system, " + "or they are in the wrong order or in the wrong location; " + "for example, an effect expected in hardware " + "was found in software"; #endif #ifdef DSERR_GENERIC case DSERR_GENERIC: - str =3D "An undetermined error occurred inside the DirectSound sub= system"; - break; + return "An undetermined error occurred inside the DirectSound subs= ystem"; #endif #ifdef DSERR_INVALIDCALL case DSERR_INVALIDCALL: - str =3D "This function is not valid for the current state of this = object"; - break; + return "This function is not valid for the current state of this o= bject"; #endif #ifdef DSERR_INVALIDPARAM case DSERR_INVALIDPARAM: - str =3D "An invalid parameter was passed to the returning function= "; - break; + return "An invalid parameter was passed to the returning function"; #endif #ifdef DSERR_NOAGGREGATION case DSERR_NOAGGREGATION: - str =3D "The object does not support aggregation"; - break; + return "The object does not support aggregation"; #endif #ifdef DSERR_NODRIVER case DSERR_NODRIVER: - str =3D "No sound driver is available for use, " - "or the given GUID is not a valid DirectSound device ID"; - break; + return "No sound driver is available for use, " + "or the given GUID is not a valid DirectSound device ID"; #endif #ifdef DSERR_NOINTERFACE case DSERR_NOINTERFACE: - str =3D "The requested COM interface is not available"; - break; + return "The requested COM interface is not available"; #endif #ifdef DSERR_OBJECTNOTFOUND case DSERR_OBJECTNOTFOUND: - str =3D "The requested object was not found"; - break; + return "The requested object was not found"; #endif #ifdef DSERR_OTHERAPPHASPRIO case DSERR_OTHERAPPHASPRIO: - str =3D "Another application has a higher priority level, " + return "Another application has a higher priority level, " "preventing this call from succeeding"; - break; #endif #ifdef DSERR_OUTOFMEMORY case DSERR_OUTOFMEMORY: - str =3D "The DirectSound subsystem could not allocate " + return "The DirectSound subsystem could not allocate " "sufficient memory to complete the caller's request"; - break; #endif #ifdef DSERR_PRIOLEVELNEEDED case DSERR_PRIOLEVELNEEDED: - str =3D "A cooperative level of DSSCL_PRIORITY or higher is requir= ed"; - break; + return "A cooperative level of DSSCL_PRIORITY or higher is require= d"; #endif #ifdef DSERR_SENDLOOP case DSERR_SENDLOOP: - str =3D "A circular loop of send effects was detected"; - break; + return "A circular loop of send effects was detected"; #endif #ifdef DSERR_UNINITIALIZED case DSERR_UNINITIALIZED: - str =3D "The Initialize method has not been called " - "or has not been called successfully " - "before other methods were called"; - break; + return "The Initialize method has not been called " + "or has not been called successfully " + "before other methods were called"; #endif #ifdef DSERR_UNSUPPORTED case DSERR_UNSUPPORTED: - str =3D "The function called is not supported at this time"; - break; + return "The function called is not supported at this time"; #endif default: - AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT 0x%lx)\n", hr); - return; + return NULL; + } + +} + +static void dserror_set(Error **errp, HRESULT hr, const char *msg) +{ + const char *str =3D dserror(hr); + + if (str) { + error_setg(errp, "%s: %s", msg, str); + } else { + error_setg(errp, "%s: Unknown (HRESULT: 0x%lx)", msg, hr); } +} + +static void dsound_log_hresult (HRESULT hr) +{ + const char *str =3D dserror(hr); =20 - AUD_log (AUDIO_CAP, "Reason: %s\n", str); + if (str) { + AUD_log (AUDIO_CAP, "Reason: %s\n", str); + } else { + AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT: 0x%lx)\n", hr); + } } =20 static void G_GNUC_PRINTF (2, 3) dsound_logerr ( @@ -359,27 +352,6 @@ static void dsound_clear_sample (HWVoiceOut *hw, LPDIR= ECTSOUNDBUFFER dsb, dsound_unlock_out (dsb, p1, p2, blen1, blen2); } =20 -static int dsound_set_cooperative_level(dsound *s) -{ - HRESULT hr; - HWND hwnd; - - hwnd =3D GetDesktopWindow(); - hr =3D IDirectSound_SetCooperativeLevel ( - s->dsound, - hwnd, - DSSCL_PRIORITY - ); - - if (FAILED (hr)) { - dsound_logerr (hr, "Could not set cooperative level for window %p\= n", - hwnd); - return -1; - } - - return 0; -} - static void dsound_enable_out(HWVoiceOut *hw, bool enable) { HRESULT hr; @@ -621,7 +593,6 @@ static void dsound_audio_fini (void *opaque) =20 static void *dsound_audio_init(Audiodev *dev, Error **errp) { - int err; HRESULT hr; dsound *s =3D g_new0(dsound, 1); AudiodevDsoundOptions *dso; @@ -637,7 +608,7 @@ static void *dsound_audio_init(Audiodev *dev, Error **e= rrp) =20 hr =3D CoInitialize (NULL); if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize COM\n"); + dserror_set(errp, hr, "Could not initialize COM"); dsound_audio_fini(s); return NULL; } @@ -650,14 +621,14 @@ static void *dsound_audio_init(Audiodev *dev, Error *= *errp) (void **) &s->dsound ); if (FAILED (hr)) { - dsound_logerr (hr, "Could not create DirectSound instance\n"); + dserror_set(errp, hr, "Could not create DirectSound instance"); dsound_audio_fini(s); return NULL; } =20 hr =3D IDirectSound_Initialize (s->dsound, NULL); if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize DirectSound\n"); + dserror_set(errp, hr, "Could not initialize DirectSound"); dsound_audio_fini(s); return NULL; } @@ -670,21 +641,26 @@ static void *dsound_audio_init(Audiodev *dev, Error *= *errp) (void **) &s->dsound_capture ); if (FAILED (hr)) { - dsound_logerr (hr, "Could not create DirectSoundCapture instance\n= "); + dserror_set(errp, hr, "Could not create DirectSoundCapture instanc= e"); dsound_audio_fini(s); return NULL; } =20 hr =3D IDirectSoundCapture_Initialize (s->dsound_capture, NULL); if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize DirectSoundCapture\n"); + dserror_set(errp, hr, "Could not initialize DirectSoundCapture"); dsound_audio_fini(s); return NULL; } =20 - err =3D dsound_set_cooperative_level(s); - if (err) { - dsound_audio_fini (s); + hr =3D IDirectSound_SetCooperativeLevel ( + s->dsound, + GetDesktopWindow(), + DSSCL_PRIORITY + ); + if (FAILED (hr)) { + dserror_set(errp, hr, "Could not set cooperative level"); + dsound_audio_fini(s); return NULL; } =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037563; cv=none; d=zohomail.com; s=zohoarc; b=fVkFb3JmidmM3HXZsnpaip02IG5zc7mvfrn+L0ytNnr2oMjovisydTYs+Z9VCieOeyoAb2l8rwji48a7KWcH+G6IfuHWDroUKP9WvCpW1olDFroD+krG3OtpSSzwx+iArDKiABN8gwfjpj9nWvSIBn0oR0YSRIj5CWX5ZQbJHmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037563; 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=juic9oRRoPnEyyLc+RZtMFFg/bc4UccwpaWA/hiu/p8=; b=XsfJNQRJe7y+ttyG/93rjmolBkKGPbBrmEb63U2LbmZPz+wD/tokEj0Bdf8KUkCmW+mKHzRLLpDcNFDx8SamD++mYZmpyLjZkHaCli6ZjT0RSqjfhZ6rklkm2uS4UBFQw6+kNKpeM8J4oEhLWjzEft9rvJmvz+LAS9N2LxNxRno= 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 1761037562917990.8778197906328; Tue, 21 Oct 2025 02:06:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8J8-0003Cz-H8; Tue, 21 Oct 2025 05:05:30 -0400 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 1vB8J7-00039s-2x for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:29 -0400 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 1vB8J5-0004E1-6C for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:28 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-HF1QJhIMMOeI5yjXwE_R3w-1; Tue, 21 Oct 2025 05:05:24 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA253180060D; Tue, 21 Oct 2025 09:05:23 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 66D1F30001BE; Tue, 21 Oct 2025 09:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037526; 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=juic9oRRoPnEyyLc+RZtMFFg/bc4UccwpaWA/hiu/p8=; b=MGjHMF8vBQiOE3IbNQgTKM3i+E7tVLkI0tX7p4jwBeZtc1saxaTf4bu+EcOYlNFHxit1Tf KBIDhvRxU3VnTH0oJ3rU4sn7HnlGAUFhrOhgbR8CMqanDCWS1kC9ZkDFVB+v08cOPcnHUM IDbDn8LivsntgCggPQL7o2Kz5GEC7Wk= X-MC-Unique: HF1QJhIMMOeI5yjXwE_R3w-1 X-Mimecast-MFC-AGG-ID: HF1QJhIMMOeI5yjXwE_R3w_1761037523 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 22/43] audio: simplify audio_driver_init() Date: Tue, 21 Oct 2025 13:02:53 +0400 Message-ID: <20251021090317.425409-23-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037565372154100 From: Marc-Andr=C3=A9 Lureau Catch and return from error early to avoid indentations and ease the flow & return a bool for success value. All driver init() calls have been checked to set errp on error. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.c | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 3af5f2670b..bffb8cddb0 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1562,35 +1562,27 @@ size_t audio_generic_read(HWVoiceIn *hw, void *buf,= size_t size) return total; } =20 -static int audio_driver_init(AudioState *s, struct audio_driver *drv, - Audiodev *dev, Error **errp) +static bool audio_driver_init(AudioState *s, struct audio_driver *drv, + Audiodev *dev, Error **errp) { - Error *local_err =3D NULL; - - s->drv_opaque =3D drv->init(dev, &local_err); - - if (s->drv_opaque) { - if (!drv->pcm_ops->get_buffer_in) { - drv->pcm_ops->get_buffer_in =3D audio_generic_get_buffer_in; - drv->pcm_ops->put_buffer_in =3D audio_generic_put_buffer_in; - } - if (!drv->pcm_ops->get_buffer_out) { - drv->pcm_ops->get_buffer_out =3D audio_generic_get_buffer_out; - drv->pcm_ops->put_buffer_out =3D audio_generic_put_buffer_out; - } + s->drv_opaque =3D drv->init(dev, errp); + if (!s->drv_opaque) { + return false; + } =20 - audio_init_nb_voices_out(s, drv, 1); - audio_init_nb_voices_in(s, drv, 0); - s->drv =3D drv; - return 0; - } else { - if (local_err) { - error_propagate(errp, local_err); - } else { - error_setg(errp, "Could not init `%s' audio driver", drv->name= ); - } - return -1; + if (!drv->pcm_ops->get_buffer_in) { + drv->pcm_ops->get_buffer_in =3D audio_generic_get_buffer_in; + drv->pcm_ops->put_buffer_in =3D audio_generic_put_buffer_in; } + if (!drv->pcm_ops->get_buffer_out) { + drv->pcm_ops->get_buffer_out =3D audio_generic_get_buffer_out; + drv->pcm_ops->put_buffer_out =3D audio_generic_put_buffer_out; + } + + audio_init_nb_voices_out(s, drv, 1); + audio_init_nb_voices_in(s, drv, 0); + s->drv =3D drv; + return true; } =20 static void audio_vm_change_state_handler (void *opaque, bool running, @@ -1748,7 +1740,7 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) drvname =3D AudiodevDriver_str(dev->driver); driver =3D audio_driver_lookup(drvname); if (driver) { - done =3D !audio_driver_init(s, driver, dev, errp); + done =3D audio_driver_init(s, driver, dev, errp); } else { error_setg(errp, "Unknown audio driver `%s'", drvname); } @@ -1768,7 +1760,7 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) g_free(e); drvname =3D AudiodevDriver_str(dev->driver); driver =3D audio_driver_lookup(drvname); - if (!audio_driver_init(s, driver, dev, NULL)) { + if (audio_driver_init(s, driver, dev, NULL)) { break; } qapi_free_Audiodev(dev); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037769; cv=none; d=zohomail.com; s=zohoarc; b=kb6oul1MDbhxA/v8GkWvMfj3Ei+CN7aIQr6Hz9ee+aZRJ2hDFi+q61FwDTCxWi5Rew7BqBoydYHGd9CVorUEQ14fNhr/I5NDZjRs3bou1a/gWp+JkPHAknYx0fz0KQ86nopd67hVywrEnprwEZYSj5MWmTKYM9wdhbokfb/pm40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037769; 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=5VivmlLMnXRxx6PS1LLoJpztwyYc6uGdFp5WcViyarE=; b=GOR4BWCBQADrnKM8PfszWTUgZA+u640EFygavKU41vP1DAia96rFpayl+x5DxzGpgrVW7igqBs3uze5SWuGxFK6wvxmgfm7C6qlI2nfglKj0b0Ti/MB1Rh1SQ+5eYEX/DaLw3pgCy+9lB9F0kvOiRbSXvvjgcsEXpqxGPd6QovE= 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 17610377698661003.7712608276454; Tue, 21 Oct 2025 02:09:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8JH-0003Zq-Ce; Tue, 21 Oct 2025 05:05:39 -0400 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 1vB8JF-0003UP-NU for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8JD-0004EV-NQ for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:37 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-nI1T6DU0NV6HgG1YILpHyQ-1; Tue, 21 Oct 2025 05:05:30 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B477180135A; Tue, 21 Oct 2025 09:05:29 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EDE191800577; Tue, 21 Oct 2025 09:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037534; 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=5VivmlLMnXRxx6PS1LLoJpztwyYc6uGdFp5WcViyarE=; b=AELGKKyLzLfOX74cPXGJho6FHKuxlMYJNZPrdTp3cZisvcL3XoLy0VL8gZ//vOaHwP/nsW CQjaOM0Y3KVUOJcD9AvDHhKQBzcucN/yiT/5yJu9Duu0TyU3RwDHtLPK0Svxzil94+XagJ BV/oo/pRXvDvonp8QhdCpU5dgFB9WBE= X-MC-Unique: nI1T6DU0NV6HgG1YILpHyQ-1 X-Mimecast-MFC-AGG-ID: nI1T6DU0NV6HgG1YILpHyQ_1761037529 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 23/43] audio: move period tick initialization Date: Tue, 21 Oct 2025 13:02:54 +0400 Message-ID: <20251021090317.425409-24-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037771401158500 From: Marc-Andr=C3=A9 Lureau Part of QOM-ification. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index bffb8cddb0..dcaf86a586 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1582,6 +1582,13 @@ static bool audio_driver_init(AudioState *s, struct = audio_driver *drv, audio_init_nb_voices_out(s, drv, 1); audio_init_nb_voices_in(s, drv, 0); s->drv =3D drv; + + if (dev->timer_period <=3D 0) { + s->period_ticks =3D 1; + } else { + s->period_ticks =3D dev->timer_period * (int64_t)SCALE_US; + } + return true; } =20 @@ -1768,12 +1775,6 @@ static AudioState *audio_init(Audiodev *dev, Error *= *errp) } } =20 - if (dev->timer_period <=3D 0) { - s->period_ticks =3D 1; - } else { - s->period_ticks =3D dev->timer_period * (int64_t)SCALE_US; - } - vmse =3D qemu_add_vm_change_state_handler (audio_vm_change_state_handl= er, s); if (!vmse) { dolog ("warning: Could not register change state handler\n" --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037943; cv=none; d=zohomail.com; s=zohoarc; b=VaNCxpLWQnhMS9faq3JVTeNzNrjrWfsBwlu4PZjmv3uzNPBwGQrdPE+YCe/dzd0smsA6x1DUQXn2H/baLJZuKNniUXL+hZHcYFVuICHWd7S7CunOjmLgVb0JPKiYhqZICAqFXktJctCOhr7SrNpl2XPMY77f2Fy4kfA/SpwXk2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037943; 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=z3iIUtb7cIX94DkQb9F7TLax93AdBG1w2HRzW7aZl8U=; b=b7lgGvkE7buVn/7GnUV7us7NQ/fembRWWdCw2AYn/qAtrzDiBQAC4DmRvb3PJ6ZLsCTirn5SAJly3nX6NFVcZTBaKZZLe1aMYNDiMZ4MAwzvnPcxhAtTs2tyT3ekFA2xDWBhdjsR7LTvggae2j9P0D0Bfwb9LdHZXdR9UxalZIk= 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 1761037943560635.7462993338015; Tue, 21 Oct 2025 02:12:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8JM-0003il-3P; Tue, 21 Oct 2025 05:05:44 -0400 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 1vB8JL-0003gf-0w for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8JJ-0004Ez-9t for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:42 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-zJw2g_4WPhiCsZX8inxrOw-1; Tue, 21 Oct 2025 05:05:35 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA9751809A00; Tue, 21 Oct 2025 09:05:34 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 46FB51955F22; Tue, 21 Oct 2025 09:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037540; 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=z3iIUtb7cIX94DkQb9F7TLax93AdBG1w2HRzW7aZl8U=; b=F+qP93yH24QXzbbo59LqM6hLxi6/XZtTz7AQcJQMCkm35enTyHUrU6Iv5cnmdynkKnQt/h hjS5598pGwqoPIy1/p9jtAr2CNNkbkS6ZmcLQyrG2C6+bQDIUd5NuxO0bVO5nut9dFtLTi qZXlBdhZi6rfzC+s8TKOI9M9ZGVqA4M= X-MC-Unique: zJw2g_4WPhiCsZX8inxrOw-1 X-Mimecast-MFC-AGG-ID: zJw2g_4WPhiCsZX8inxrOw_1761037534 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 24/43] audio: drop needless error message Date: Tue, 21 Oct 2025 13:02:55 +0400 Message-ID: <20251021090317.425409-25-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037947393158500 From: Marc-Andr=C3=A9 Lureau The only reason it would fail to add the handler is if it's calling a stub. But this cannot happen as audio is only supported with system qemu. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index dcaf86a586..4478041e5d 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1776,10 +1776,7 @@ static AudioState *audio_init(Audiodev *dev, Error *= *errp) } =20 vmse =3D qemu_add_vm_change_state_handler (audio_vm_change_state_handl= er, s); - if (!vmse) { - dolog ("warning: Could not register change state handler\n" - "(Audio can continue looping even after stopping the VM)\n"= ); - } + assert(vmse !=3D NULL); =20 if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJE= CT(s), errp)) { goto out; --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037639; cv=none; d=zohomail.com; s=zohoarc; b=WCJR3+V+7zJHBQhkdsXhVXKDUK0fj8ZG9N8VmL/eIpqSDmZrser1ceJwgeevQcGWjZpsjx9KZ5zlu0bxmCRXT4jH3Wp/HvpOJ7tOcz+hygNlpcIHOhhX1LdTGhaoYBg13lfIYEZ7va6nFBtm1Gg+S1p5LCYC52KXpsgYlm7oE1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037639; 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=U3qEMyN2Ig2MXdwLXWBdlvpZ1JIUr5GwgkG+gBGafMQ=; b=cBu/Ed3vupYsJfO5pnsMy9GXi9xRFw/ENcqm8z/VrmYXou1nBlf5fJHuCwslrVLTCqCNn3aIpgNTb7fiINC6yWzFV5XN9XPA9hNc4DMXAY8BKUPDT0TXLve+GFl/m/a0iZnwpjnJh2apghH9kM+hOKr04iBNxqVGSiiRCO6Ng3A= 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 1761037639375987.3462073315802; Tue, 21 Oct 2025 02:07:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8JX-0003qI-2z; Tue, 21 Oct 2025 05:05:58 -0400 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 1vB8JP-0003lt-K9 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:47 -0400 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 1vB8JN-0004FD-8l for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:46 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-283-gfTZBzQ1N4mEvp-Bm4dlUg-1; Tue, 21 Oct 2025 05:05:40 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D09F180121E; Tue, 21 Oct 2025 09:05:39 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A64A91800451; Tue, 21 Oct 2025 09:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037544; 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=U3qEMyN2Ig2MXdwLXWBdlvpZ1JIUr5GwgkG+gBGafMQ=; b=jRdorxDjziBtL6+BBBhIy6vf81rqfCXGpuah75rTJz33ia17rLe9wHM7BlBwtpvmu5ZuIy SIUdIy/MsPToElwQJGe539TkrZHE33QBqF7RNr5+n+Hj8ur4qnSzfP/78/jNeiU3QHjmYM 1427n3A4UXLhVuGBEtJhQPqjf2dNTVw= X-MC-Unique: gfTZBzQ1N4mEvp-Bm4dlUg-1 X-Mimecast-MFC-AGG-ID: gfTZBzQ1N4mEvp-Bm4dlUg_1761037539 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 25/43] audio: clean-up vmstate change handler on finalize Date: Tue, 21 Oct 2025 13:02:56 +0400 Message-ID: <20251021090317.425409-26-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037641897158500 From: Marc-Andr=C3=A9 Lureau QOM-ification continues. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 1 + audio/audio.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 4187a2dbfc..4a4d69f2bf 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -235,6 +235,7 @@ typedef struct AudioState { =20 bool timer_running; uint64_t timer_last; + VMChangeStateEntry *vmse; } AudioState; =20 extern const struct mixeng_volume nominal_volume; diff --git a/audio/audio.c b/audio/audio.c index 4478041e5d..b39b86cc2e 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1622,6 +1622,9 @@ static void audio_state_init(Object *obj) QLIST_INIT (&s->hw_head_in); QLIST_INIT (&s->cap_head); s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); + + s->vmse =3D qemu_add_vm_change_state_handler(audio_vm_change_state_han= dler, s); + assert(s->vmse !=3D NULL); } =20 static void audio_state_finalize(Object *obj) @@ -1671,6 +1674,11 @@ static void audio_state_finalize(Object *obj) timer_free(s->ts); s->ts =3D NULL; } + + if (s->vmse) { + qemu_del_vm_change_state_handler(s->vmse); + s->vmse =3D NULL; + } } =20 static Object *get_audiodevs_root(void) @@ -1735,7 +1743,6 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) { int done =3D 0; const char *drvname; - VMChangeStateEntry *vmse; AudioState *s; struct audio_driver *driver; =20 @@ -1775,9 +1782,6 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) } } =20 - vmse =3D qemu_add_vm_change_state_handler (audio_vm_change_state_handl= er, s); - assert(vmse !=3D NULL); - if (!object_property_try_add_child(get_audiodevs_root(), dev->id, OBJE= CT(s), errp)) { goto out; } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037730; cv=none; d=zohomail.com; s=zohoarc; b=bEtRmRmzy2DAbq3OaH+5gvvM6k+Ucw+mmgLehXjs+y+XKPlXagRS/ixDFEstyaMCHi0K0iWUpP/8MRZBmXkaoODEGRtXyo3uEZAKRkaLvbf/ssx+JYHFJgU3nqnsAlw+NK7I2fCxYRe+KksjNjY20plUS7dN3CDxhUKnb0dety0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037730; 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=YAafkmBEG44dEvteX7fLDwSFhNPhRmmSpWk7ihmCK6E=; b=g2nQSl6Kv3PusD1d3Pg6UgxOE1VeBcRE6Cxqp3s38h9m0hSozPDvn5/+5bmZtnJivfv/1zt1Urgga7M/NyayxUIRb6dvwCb5rAwS9rm7eCu2OFCpcfwsQltCFBmx3YZB+eWRoWd0xxwDj9+cUQ3paBOBbBGVzSeBZ94lYYkA5h0= 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 1761037730846897.9419230567702; Tue, 21 Oct 2025 02:08:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Jf-000484-Ez; Tue, 21 Oct 2025 05:06:05 -0400 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 1vB8JV-0003q7-61 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8JS-0004Fd-SY for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:52 -0400 Received: from mx-prod-mc-03.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-426-_DITWIAGPbCTkIaFqChIFQ-1; Tue, 21 Oct 2025 05:05:45 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8300E195606C; Tue, 21 Oct 2025 09:05:44 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 49435195419F; Tue, 21 Oct 2025 09:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037550; 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=YAafkmBEG44dEvteX7fLDwSFhNPhRmmSpWk7ihmCK6E=; b=fCyN49fKHa1qHKY+nZFEL9ztsft1bb5oF3NhhERFKmsV0i4Celrls2PMmMpu+DzCdBrP+y Ehn22HKSeeQ1h4f82SAlGD0PgWOQF0G6jXatHFE7m4ZxchXw1nPPMv9Fp6QRZAfVjePQ8N N+MgN2mscMMGzw6Smg/qhEo7rQvWYvA= X-MC-Unique: _DITWIAGPbCTkIaFqChIFQ-1 X-Mimecast-MFC-AGG-ID: _DITWIAGPbCTkIaFqChIFQ_1761037544 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 26/43] audio: unregister vmstate description Date: Tue, 21 Oct 2025 13:02:57 +0400 Message-ID: <20251021090317.425409-27-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037733321154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index b39b86cc2e..e610e8453a 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1614,6 +1614,8 @@ static void audio_vm_change_state_handler (void *opaq= ue, bool running, audio_reset_timer (s); } =20 +static const VMStateDescription vmstate_audio; + static void audio_state_init(Object *obj) { AudioState *s =3D AUDIO_STATE(obj); @@ -1625,6 +1627,8 @@ static void audio_state_init(Object *obj) =20 s->vmse =3D qemu_add_vm_change_state_handler(audio_vm_change_state_han= dler, s); assert(s->vmse !=3D NULL); + + vmstate_register_any(NULL, &vmstate_audio, s); } =20 static void audio_state_finalize(Object *obj) @@ -1679,6 +1683,8 @@ static void audio_state_finalize(Object *obj) qemu_del_vm_change_state_handler(s->vmse); s->vmse =3D NULL; } + + vmstate_unregister(NULL, &vmstate_audio, s); } =20 static Object *get_audiodevs_root(void) @@ -1787,7 +1793,6 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) } object_unref(s); QLIST_INIT (&s->card_head); - vmstate_register_any(NULL, &vmstate_audio, s); return s; =20 out: --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037799; cv=none; d=zohomail.com; s=zohoarc; b=msXvixdEONvBH6ifTWFjRw/Klk5l4Lj9QiOa2KTqOTXAkVpXHxp//IcDNZLgiwXvNGw4FeXT2RA/LzdfDsIm/HZfOdQAAT82VxqMCsqlpK4HFLv1XuYAfwXQKzvp860KsKgVHbZ6ZxatuV1fNdzSXEqcwQz8YQ52V9O+jxdgfME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037799; 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=P57rDjV56wJcNLKbnw+B9+K7vaTUKBKpvQyIeUi4jI4=; b=F/HNQftrnRbLhyiOt/WBB/28C/SIH2Fb5TuccSMYVAG5eHc1W+/QhkYG3ryOFKbJqrxmHLfBx0/KUcCrZ8v4FIUcrCqE92fsTfrscXvlkv9bV/ypY/UxCNE/iRtCYp9f7MeCsE5rAFr/CtjEBOf2O0A32AUNudHl8nt11gQtM/Y= 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 1761037799395727.5251228429815; Tue, 21 Oct 2025 02:09:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Jn-0004CS-7U; Tue, 21 Oct 2025 05:06:11 -0400 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 1vB8Je-000482-Nc for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:03 -0400 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 1vB8JY-0004Fu-J2 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:05:59 -0400 Received: from mx-prod-mc-04.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-49-ciXrXO6qOjKB6SQR2IvXSg-1; Tue, 21 Oct 2025 05:05:50 -0400 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E57001954197; Tue, 21 Oct 2025 09:05:49 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 91CBF180035A; Tue, 21 Oct 2025 09:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037554; 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=P57rDjV56wJcNLKbnw+B9+K7vaTUKBKpvQyIeUi4jI4=; b=R/lxptNqKBvu1l8blNL2UEGdpjArakDxzXlEIuzCICSds6RfpNaUeDoaf0M+dljsni0mLB 3+/AmStyrbyUttQUz7vH7lVAhT8fQFJUgCZzOi8zOHE4YLpO389L+YYJC2Mk8Fuv7KniV+ 9Wz2TlmSa6Eq7LVtRI5lwlOMaqjpaM8= X-MC-Unique: ciXrXO6qOjKB6SQR2IvXSg-1 X-Mimecast-MFC-AGG-ID: ciXrXO6qOjKB6SQR2IvXSg_1761037550 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 27/43] audio: initialize card_head during object init Date: Tue, 21 Oct 2025 13:02:58 +0400 Message-ID: <20251021090317.425409-28-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037811874158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index e610e8453a..934a67ad19 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1623,6 +1623,7 @@ static void audio_state_init(Object *obj) QLIST_INIT (&s->hw_head_out); QLIST_INIT (&s->hw_head_in); QLIST_INIT (&s->cap_head); + QLIST_INIT (&s->card_head); s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); =20 s->vmse =3D qemu_add_vm_change_state_handler(audio_vm_change_state_han= dler, s); @@ -1792,7 +1793,6 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) goto out; } object_unref(s); - QLIST_INIT (&s->card_head); return s; =20 out: --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037772; cv=none; d=zohomail.com; s=zohoarc; b=DlpqiLt0Dx1P6QoSd57z3fVARHxsdtLfCEkgWxyMrCMtsNT6SBObTijqRRK/5mUoHFFn2n6L8nJjEcBpLKxGB0gYJ/i57Pyqpq125mMGX8LstCrrfgYzb7SimT1f7CgAaG+35uYobPTNI0DVNItCejTcn8SY9iD3cGHOlAG+uQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037772; 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=0IKJ1Ws/UNnAOSMqJqiAkjVIMdrL3tCZMUq99IEVYyQ=; b=JGdxksF05ukNL+SvLjUlogMCgSgYO/cNoUFI+VM3CZ2Sd0fYwyuTwwIB3cn5n+eHizEzMIioQCc+VyOD1GEtBReGQmjamsbq66oanisgj8rUzLbe5QrGTIZU4FWWSBhJA4KnyTKfCPch2oSa6gAxuxibep8iumOG1qdFV29zayw= 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 1761037772123159.60970847627834; Tue, 21 Oct 2025 02:09:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Jo-0004JX-Au; Tue, 21 Oct 2025 05:06:12 -0400 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 1vB8Jg-00049V-Ai for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Je-0004G8-Cn for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:04 -0400 Received: from mx-prod-mc-04.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-2-AAlTVaTBPy2dVbp7JLiXoQ-1; Tue, 21 Oct 2025 05:05:56 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 460161954199; Tue, 21 Oct 2025 09:05:55 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 02C2F30001BE; Tue, 21 Oct 2025 09:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037559; 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=0IKJ1Ws/UNnAOSMqJqiAkjVIMdrL3tCZMUq99IEVYyQ=; b=PQ9+7GT5pZPdcJpGH6aSspu5Jh9RtYA2wy6xJyufihnlkWS1a0lmziAVaso+v7eapW6goj xUrf1lhV0WOYeGn7Z+dIU2A1hW7iuRIJYgJNGkOjWj3LSfOI2kxvtEnXHgwlJeM/NX+OkW rF4AYvg1gW73sOPKsToVB29r8RCjWC8= X-MC-Unique: AAlTVaTBPy2dVbp7JLiXoQ-1 X-Mimecast-MFC-AGG-ID: AAlTVaTBPy2dVbp7JLiXoQ_1761037555 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 28/43] audio: remove some needless headers Date: Tue, 21 Oct 2025 13:02:59 +0400 Message-ID: <20251021090317.425409-29-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037773680154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 1 - audio/audio.c | 3 --- audio/dbusaudio.c | 2 -- audio/dsoundaudio.c | 1 - audio/mixeng.c | 4 +++- audio/noaudio.c | 2 -- audio/wavaudio.c | 3 --- audio/wavcapture.c | 1 - 8 files changed, 3 insertions(+), 14 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index f56a8c8baf..58fa8d7423 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -27,7 +27,6 @@ =20 #include "qemu/queue.h" #include "qapi/qapi-types-audio.h" -#include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" =20 typedef void (*audio_callback_fn) (void *opaque, int avail); diff --git a/audio/audio.c b/audio/audio.c index 934a67ad19..0f3093ad59 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "audio.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "qemu/timer.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" @@ -33,7 +32,6 @@ #include "qapi/qapi-visit-audio.h" #include "qapi/qapi-commands-audio.h" #include "qobject/qdict.h" -#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/module.h" @@ -41,7 +39,6 @@ #include "system/system.h" #include "system/replay.h" #include "system/runstate.h" -#include "ui/qemu-spice.h" #include "trace.h" =20 #define AUDIO_CAP "audio" diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index b44fdd1511..908214a170 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -24,9 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" -#include "qemu/host-utils.h" #include "qemu/module.h" -#include "qemu/timer.h" #include "qemu/dbus.h" =20 #ifdef G_OS_UNIX diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 6a8b7f1a19..003ef27365 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -31,7 +31,6 @@ =20 #define AUDIO_CAP "dsound" #include "audio_int.h" -#include "qemu/host-utils.h" #include "qemu/module.h" #include "qapi/error.h" =20 diff --git a/audio/mixeng.c b/audio/mixeng.c index 703ee5448f..be38617e9b 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -24,11 +24,13 @@ */ #include "qemu/osdep.h" #include "qemu/bswap.h" -#include "qemu/error-report.h" #include "audio.h" =20 #define AUDIO_CAP "mixeng" #include "audio_int.h" +#ifdef FLOAT_MIXENG +#include "qemu/error-report.h" +#endif =20 /* 8 bit */ #define ENDIAN_CONVERSION natural diff --git a/audio/noaudio.c b/audio/noaudio.c index 1b60d8518a..34ff1d2a27 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -23,10 +23,8 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/host-utils.h" #include "qemu/module.h" #include "audio.h" -#include "qemu/timer.h" =20 #define AUDIO_CAP "noaudio" #include "audio_int.h" diff --git a/audio/wavaudio.c b/audio/wavaudio.c index a8798a1c42..a098b20cad 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -23,10 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/host-utils.h" #include "qemu/module.h" -#include "qemu/timer.h" -#include "qapi/opts-visitor.h" #include "audio.h" =20 #define AUDIO_CAP "wav" diff --git a/audio/wavcapture.c b/audio/wavcapture.c index c60286e162..b990844d48 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -1,6 +1,5 @@ #include "qemu/osdep.h" #include "qemu/qemu-print.h" -#include "qapi/error.h" #include "qemu/error-report.h" #include "audio.h" =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037616; cv=none; d=zohomail.com; s=zohoarc; b=iyhtypVRKuDJE6VHt79LEkBPq6kYsHt0xuQd14miui42YLs0JKV24rp14Ofdbibzrw9bfe37I1a1IW+liMoKnDS0iT+YIHlqmrTUK+G0ZzWzbP8QsaMc7OsHLlxpgY/N36FI8kmxt1wkRHpashdc+uHDtPkz1SgGeVTOMT/hWao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037616; 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=Ah5/kHc7tX2OoT2WYx6AS8lZzdIQYHdUYg6EEQFLNKw=; b=lMOUk9XatXjT391K7lzz4WRmC9O3j+3dK99G09gBzm+CwlZRgEitUXgUv9atg8JmA/ynbnRM74aX5OwcEQWQgo5DEjGNZ0wSB8tYEJNbLohiJxpLJSgo+aojjZC5HnNf031vnzghU3oWkkyoYejAQYbPJRrp17DYegOHp9E/FGU= 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 1761037616118314.8830892614259; Tue, 21 Oct 2025 02:06:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Jp-0004Qg-Nh; Tue, 21 Oct 2025 05:06:13 -0400 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 1vB8Jm-0004D2-8f for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Jk-0004Gl-Ef for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:10 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-540-AsdQW_urNJWqxtZ-veU7SQ-1; Tue, 21 Oct 2025 05:06:02 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D6D5E180899E; Tue, 21 Oct 2025 09:06:00 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 587A3180057C; Tue, 21 Oct 2025 09:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037567; 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=Ah5/kHc7tX2OoT2WYx6AS8lZzdIQYHdUYg6EEQFLNKw=; b=ErxFQppmHwfGr6s8FZ8v150b7SCgaelKuPoQFex2MRa2uIZdllfn/U6etVCDwxpbJQdzez V5xNSjz8+yelXMkjsmsDDs67gu815svfmW+7FVKdKb+/ktALpOjAmueO4BK+NFkkRJ9yIL 0ioDQHDXezM8c7BIvp5qqPtDnTVMZa0= X-MC-Unique: AsdQW_urNJWqxtZ-veU7SQ-1 X-Mimecast-MFC-AGG-ID: AsdQW_urNJWqxtZ-veU7SQ_1761037561 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 29/43] audio: remove AUDIO_HOST_ENDIANNESS Date: Tue, 21 Oct 2025 13:03:00 +0400 Message-ID: <20251021090317.425409-30-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037618163154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 6 ------ audio/audio.c | 6 +++--- audio/spiceaudio.c | 4 ++-- hw/audio/adlib.c | 2 +- hw/audio/asc.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- 7 files changed, 9 insertions(+), 15 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 58fa8d7423..f8e4353951 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -31,12 +31,6 @@ =20 typedef void (*audio_callback_fn) (void *opaque, int avail); =20 -#if HOST_BIG_ENDIAN -#define AUDIO_HOST_ENDIANNESS 1 -#else -#define AUDIO_HOST_ENDIANNESS 0 -#endif - typedef struct audsettings { int freq; int nchannels; diff --git a/audio/audio.c b/audio/audio.c index 0f3093ad59..284ea13289 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -274,7 +274,7 @@ static int audio_pcm_info_eq (struct audio_pcm_info *in= fo, struct audsettings *a && info->is_signed =3D=3D is_signed && info->is_float =3D=3D is_float && info->bits =3D=3D bits - && info->swap_endianness =3D=3D (as->endianness !=3D AUDIO_HOST_EN= DIANNESS); + && info->swap_endianness =3D=3D (as->endianness !=3D HOST_BIG_ENDI= AN); } =20 void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings = *as) @@ -320,7 +320,7 @@ void audio_pcm_init_info (struct audio_pcm_info *info, = struct audsettings *as) info->nchannels =3D as->nchannels; info->bytes_per_frame =3D as->nchannels * mul; info->bytes_per_second =3D info->freq * info->bytes_per_frame; - info->swap_endianness =3D (as->endianness !=3D AUDIO_HOST_ENDIANNESS); + info->swap_endianness =3D (as->endianness !=3D HOST_BIG_ENDIAN); } =20 void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int= len) @@ -2179,7 +2179,7 @@ audsettings audiodev_to_audsettings(AudiodevPerDirect= ionOptions *pdo) .freq =3D pdo->frequency, .nchannels =3D pdo->channels, .fmt =3D pdo->format, - .endianness =3D AUDIO_HOST_ENDIANNESS, + .endianness =3D HOST_BIG_ENDIAN, }; } =20 diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 7f02f7285c..7e737bff9a 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -102,7 +102,7 @@ static int line_out_init(HWVoiceOut *hw, struct audsett= ings *as, #endif settings.nchannels =3D SPICE_INTERFACE_PLAYBACK_CHAN; settings.fmt =3D AUDIO_FORMAT_S16; - settings.endianness =3D AUDIO_HOST_ENDIANNESS; + settings.endianness =3D HOST_BIG_ENDIAN; =20 audio_pcm_init_info (&hw->info, &settings); hw->samples =3D LINE_OUT_SAMPLES; @@ -218,7 +218,7 @@ static int line_in_init(HWVoiceIn *hw, struct audsettin= gs *as, void *drv_opaque) #endif settings.nchannels =3D SPICE_INTERFACE_RECORD_CHAN; settings.fmt =3D AUDIO_FORMAT_S16; - settings.endianness =3D AUDIO_HOST_ENDIANNESS; + settings.endianness =3D HOST_BIG_ENDIAN; =20 audio_pcm_init_info (&hw->info, &settings); hw->samples =3D LINE_IN_SAMPLES; diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 0bc0359ae6..50bbb97a56 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -272,7 +272,7 @@ static void adlib_realizefn (DeviceState *dev, Error **= errp) as.freq =3D s->freq; as.nchannels =3D SHIFT; as.fmt =3D AUDIO_FORMAT_S16; - as.endianness =3D AUDIO_HOST_ENDIANNESS; + as.endianness =3D HOST_BIG_ENDIAN; =20 s->voice =3D AUD_open_out ( &s->card, diff --git a/hw/audio/asc.c b/hw/audio/asc.c index edd42d6d91..41472dc2e3 100644 --- a/hw/audio/asc.c +++ b/hw/audio/asc.c @@ -650,7 +650,7 @@ static void asc_realize(DeviceState *dev, Error **errp) as.freq =3D ASC_FREQ; as.nchannels =3D 2; as.fmt =3D AUDIO_FORMAT_U8; - as.endianness =3D AUDIO_HOST_ENDIANNESS; + as.endianness =3D HOST_BIG_ENDIAN; =20 s->voice =3D AUD_open_out(&s->card, s->voice, "asc.out", s, asc_out_cb, &as); diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 18db8da324..c8837fe269 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -305,7 +305,7 @@ static void cs_reset_voices (CSState *s, uint32_t val) s->tab =3D ALawDecompressTable; x_law: as.fmt =3D AUDIO_FORMAT_S16; - as.endianness =3D AUDIO_HOST_ENDIANNESS; + as.endianness =3D HOST_BIG_ENDIAN; s->shift =3D as.nchannels =3D=3D 2; break; =20 diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 16785ce226..2c84740adf 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -254,7 +254,7 @@ static void gus_realizefn (DeviceState *dev, Error **er= rp) as.freq =3D s->freq; as.nchannels =3D 2; as.fmt =3D AUDIO_FORMAT_S16; - as.endianness =3D AUDIO_HOST_ENDIANNESS; + as.endianness =3D HOST_BIG_ENDIAN; =20 s->voice =3D AUD_open_out ( &s->card, --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037962; cv=none; d=zohomail.com; s=zohoarc; b=BN7b06wCEk445U+OuEm7PgA/VJd57Sdms+xN8RHjmXQiMgxbu0IglbzYDdTkN6OIeA2q+xQbWU1iDkgejb+pD/RX4WKygvFzb+i29cZ+k+JlMFheKYXfc2h4s+uQ4MkM2p/TMYfejSUet+W4p1y3rZt88fnhlI6DiiwFtFddkCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037962; 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=UJSxLI2FHGj7RGpL4lh1OSzR+BZ4tqFx7PzQWeVj0KY=; b=H9gdjQrbZNaAIiWjRt4DanDmgMACU3MQTfiDb6Eom0IUqA4vA1G/iHetyls39R5HTIMTEVRlbAC69O5QwuHVa2Dxli4/KLRJGcqU8z13BbFhat+2Vc3AHSGWKBOMTYPvEC4wIPj3Y2qQKNnB+bg9/o+/8I4gaOKntFxA9eEhN/4= 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 1761037962298636.7406600671675; Tue, 21 Oct 2025 02:12:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Jv-0004pE-1K; Tue, 21 Oct 2025 05:06:19 -0400 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 1vB8Jr-0004ZA-OG for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:16 -0400 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 1vB8Jo-0004H8-IZ for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:15 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-PitB49ilPSW1FTbyCnlBuA-1; Tue, 21 Oct 2025 05:06:08 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 82FEB18002C1; Tue, 21 Oct 2025 09:06:06 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D347A1800452; Tue, 21 Oct 2025 09:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037571; 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=UJSxLI2FHGj7RGpL4lh1OSzR+BZ4tqFx7PzQWeVj0KY=; b=MeuDCHdTXAFxrcSEHHGhgZD/awyR0MB8ZcMbo0BwHGZxZx2KMBcWNpGEyzR4i3TPR42E8v 9BZNLZoR+/drrZbPXN71QlBN+WeepiP7q5Oym2kjP36bdwk+laBTEjQwn+rmenGlA1I4Ik P1YaNZGQo5gQym6uO8DjfQVPzaJbNdY= X-MC-Unique: PitB49ilPSW1FTbyCnlBuA-1 X-Mimecast-MFC-AGG-ID: PitB49ilPSW1FTbyCnlBuA_1761037566 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Laurent Vivier , "Michael S. Tsirkin" , Manos Pitsidianakis , Alistair Francis , "Edgar E. Iglesias" , Peter Maydell , qemu-arm@nongnu.org (open list:Xilinx ZynqMP and...) Subject: [PATCH 30/43] audio: introduce AUD_set_volume_{in,out}_lr() Date: Tue, 21 Oct 2025 13:03:01 +0400 Message-ID: <20251021090317.425409-31-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037963854154100 From: Marc-Andr=C3=A9 Lureau Keep the AUD_ prefix for consistency. Introduce a macro to call the more flexible Volume function. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 8 ++++---- audio/audio.c | 16 ++-------------- hw/audio/ac97.c | 4 ++-- hw/audio/asc.c | 2 +- hw/audio/hda-codec.c | 4 ++-- hw/audio/lm4549.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/audio/virtio-snd.c | 4 ++-- hw/audio/wm8750.c | 12 ++++++------ hw/display/xlnx_dp.c | 2 +- hw/usb/dev-audio.c | 4 ++-- 11 files changed, 24 insertions(+), 36 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index f8e4353951..88ca0a0660 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -120,8 +120,8 @@ int AUD_is_active_out (SWVoiceOut *sw); void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); =20 -void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t r= vol); -void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvo= l); +#define AUD_set_volume_out_lr(sw, mut, lvol, rvol) AUD_set_volume_out(sw, = &(Volume) { .mute =3D mut, .channels =3D 2, .vol =3D { lvol, rvol } }) +#define AUD_set_volume_in_lr(sw, mut, lvol, rvol) AUD_set_volume_in(sw, &(= Volume) { .mute =3D mut, .channels =3D 2, .vol =3D { lvol, rvol } }) =20 #define AUDIO_MAX_CHANNELS 16 typedef struct Volume { @@ -130,8 +130,8 @@ typedef struct Volume { uint8_t vol[AUDIO_MAX_CHANNELS]; } Volume; =20 -void audio_set_volume_out(SWVoiceOut *sw, Volume *vol); -void audio_set_volume_in(SWVoiceIn *sw, Volume *vol); +void AUD_set_volume_out(SWVoiceOut *sw, Volume *vol); +void AUD_set_volume_in(SWVoiceIn *sw, Volume *vol); =20 SWVoiceIn *AUD_open_in ( QEMUSoundCard *card, diff --git a/audio/audio.c b/audio/audio.c index 284ea13289..9e6d79b4e3 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1949,13 +1949,7 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb= _opaque) } } =20 -void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t r= vol) -{ - Volume vol =3D { .mute =3D mute, .channels =3D 2, .vol =3D { lvol, rvo= l } }; - audio_set_volume_out(sw, &vol); -} - -void audio_set_volume_out(SWVoiceOut *sw, Volume *vol) +void AUD_set_volume_out(SWVoiceOut *sw, Volume *vol) { if (sw) { HWVoiceOut *hw =3D sw->hw; @@ -1971,13 +1965,7 @@ void audio_set_volume_out(SWVoiceOut *sw, Volume *vo= l) } } =20 -void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvo= l) -{ - Volume vol =3D { .mute =3D mute, .channels =3D 2, .vol =3D { lvol, rvo= l } }; - audio_set_volume_in(sw, &vol); -} - -void audio_set_volume_in(SWVoiceIn *sw, Volume *vol) +void AUD_set_volume_in(SWVoiceIn *sw, Volume *vol) { if (sw) { HWVoiceIn *hw =3D sw->hw; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 3d3c667e86..9157588dbc 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -414,7 +414,7 @@ static void update_combined_volume_out(AC97LinkState *s) lvol =3D (lvol * plvol) / 255; rvol =3D (rvol * prvol) / 255; =20 - AUD_set_volume_out(s->voice_po, mute, lvol, rvol); + AUD_set_volume_out_lr(s->voice_po, mute, lvol, rvol); } =20 static void update_volume_in(AC97LinkState *s) @@ -425,7 +425,7 @@ static void update_volume_in(AC97LinkState *s) get_volume(mixer_load(s, AC97_Record_Gain_Mute), 0x0f, 0, &mute, &lvol, &rvol); =20 - AUD_set_volume_in(s->voice_pi, mute, lvol, rvol); + AUD_set_volume_in_lr(s->voice_pi, mute, lvol, rvol); } =20 static void set_volume(AC97LinkState *s, int index, uint32_t val) diff --git a/hw/audio/asc.c b/hw/audio/asc.c index 41472dc2e3..991316e984 100644 --- a/hw/audio/asc.c +++ b/hw/audio/asc.c @@ -489,7 +489,7 @@ static void asc_write(void *opaque, hwaddr addr, uint64= _t value, { int vol =3D (value & 0xe0); =20 - AUD_set_volume_out(s->voice, 0, vol, vol); + AUD_set_volume_out_lr(s->voice, 0, vol, vol); break; } } diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 66edad280f..cc87557954 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -466,9 +466,9 @@ static void hda_audio_set_amp(HDAAudioStream *st) return; } if (st->output) { - AUD_set_volume_out(st->voice.out, muted, left, right); + AUD_set_volume_out_lr(st->voice.out, muted, left, right); } else { - AUD_set_volume_in(st->voice.in, muted, left, right); + AUD_set_volume_in_lr(st->voice.in, muted, left, right); } } =20 diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index a4a77c8dc6..dccbf56068 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -308,7 +308,7 @@ void lm4549_init(lm4549_state *s, lm4549_callback data_= req_cb, void* opaque, &as ); =20 - AUD_set_volume_out(s->voice, 0, 255, 255); + AUD_set_volume_out_lr(s->voice, 0, 255, 255); =20 s->voice_is_active =3D 0; =20 diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c index d5231e1cf2..62341e5600 100644 --- a/hw/audio/via-ac97.c +++ b/hw/audio/via-ac97.c @@ -53,7 +53,7 @@ static void codec_volume_set_out(ViaAC97State *s) rvol /=3D 255; mute =3D CODEC_REG(s, AC97_Master_Volume_Mute) >> MUTE_SHIFT; mute |=3D CODEC_REG(s, AC97_PCM_Out_Volume_Mute) >> MUTE_SHIFT; - AUD_set_volume_out(s->vo, mute, lvol, rvol); + AUD_set_volume_out_lr(s->vo, mute, lvol, rvol); } =20 static void codec_reset(ViaAC97State *s) diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index eca3319e59..88777977a9 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -463,7 +463,7 @@ static uint32_t virtio_snd_pcm_prepare(VirtIOSound *s, = uint32_t stream_id) stream, virtio_snd_pcm_out_cb, &as); - AUD_set_volume_out(stream->voice.out, 0, 255, 255); + AUD_set_volume_out_lr(stream->voice.out, 0, 255, 255); } else { stream->voice.in =3D AUD_open_in(&s->card, stream->voice.in, @@ -471,7 +471,7 @@ static uint32_t virtio_snd_pcm_prepare(VirtIOSound *s, = uint32_t stream_id) stream, virtio_snd_pcm_in_cb, &as); - AUD_set_volume_in(stream->voice.in, 0, 255, 255); + AUD_set_volume_in_lr(stream->voice.in, 0, 255, 255); } =20 return cpu_to_le32(VIRTIO_SND_S_OK); diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 2846b55fe2..7a36c4bd3f 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -145,30 +145,30 @@ static void wm8750_vol_update(WM8750State *s) { /* FIXME: multiply all volumes by s->invol[2], s->invol[3] */ =20 - AUD_set_volume_in(s->adc_voice[0], s->mute, + AUD_set_volume_in_lr(s->adc_voice[0], s->mute, s->inmute[0] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[0]), s->inmute[1] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[1])= ); - AUD_set_volume_in(s->adc_voice[1], s->mute, + AUD_set_volume_in_lr(s->adc_voice[1], s->mute, s->inmute[0] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[0]), s->inmute[1] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[1])= ); - AUD_set_volume_in(s->adc_voice[2], s->mute, + AUD_set_volume_in_lr(s->adc_voice[2], s->mute, s->inmute[0] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[0]), s->inmute[1] ? 0 : WM8750_INVOL_TRANSFORM(s->invol[1])= ); =20 /* FIXME: multiply all volumes by s->outvol[0], s->outvol[1] */ =20 /* Speaker: LOUT2VOL ROUT2VOL */ - AUD_set_volume_out(s->dac_voice[0], s->mute, + AUD_set_volume_out_lr(s->dac_voice[0], s->mute, s->outmute[0] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 4]), s->outmute[1] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 5])); =20 /* Headphone: LOUT1VOL ROUT1VOL */ - AUD_set_volume_out(s->dac_voice[1], s->mute, + AUD_set_volume_out_lr(s->dac_voice[1], s->mute, s->outmute[0] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 2]), s->outmute[1] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 3])); =20 /* MONOOUT: MONOVOL MONOVOL */ - AUD_set_volume_out(s->dac_voice[2], s->mute, + AUD_set_volume_out_lr(s->dac_voice[2], s->mute, s->outmute[0] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 6]), s->outmute[1] ? 0 : WM8750_OUTVOL_TRANSFORM(s->outvol[= 6])); } diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index ef73e1815f..882ae3c4b4 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1334,7 +1334,7 @@ static void xlnx_dp_realize(DeviceState *dev, Error *= *errp) s, xlnx_dp_audio_callback, &as); - AUD_set_volume_out(s->amixer_output_stream, 0, 255, 255); + AUD_set_volume_out_lr(s->amixer_output_stream, 0, 255, 255); xlnx_dp_audio_activate(s); s->vblank =3D ptimer_init(vblank_hit, s, DP_VBLANK_PTIMER_POLICY); ptimer_transaction_begin(s->vblank); diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 26af709f31..f59e5a53f0 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -805,7 +805,7 @@ static int usb_audio_set_control(USBAudioState *s, uint= 8_t attrib, } fprintf(stderr, "\n"); } - audio_set_volume_out(s->out.voice, &s->out.vol); + AUD_set_volume_out(s->out.voice, &s->out.vol); } =20 return ret; @@ -981,7 +981,7 @@ static void usb_audio_reinit(USBDevice *dev, unsigned c= hannels) =20 s->out.voice =3D AUD_open_out(&s->card, s->out.voice, TYPE_USB_AUDIO, s, output_callback, &s->out.as); - audio_set_volume_out(s->out.voice, &s->out.vol); + AUD_set_volume_out(s->out.voice, &s->out.vol); AUD_set_active_out(s->out.voice, 0); } =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037945; cv=none; d=zohomail.com; s=zohoarc; b=kK5Y7HZocXqw+E8gkURHPUNyiKDcnBieE6iGNT6750OmiLGTpmWle+BCzWe8+Il+XajSpcbm1tRzX4PGTfft077A5SiwYrRjGtzTdQdHrZ/ONu1gj1k81r2n2PV06qbUxf18CXeUkWAXxwD3O2KaCwmDE6P7iixH67A9YQR+4PY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037945; 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=nmXqy4w9Xp3d871swaw2TtPMrWUPX5OISXyRJWRiPhU=; b=NOscf/wmnalnJjmmhFli4KLXyk60gANOqyttP62QWg93uzTaoJHubBKAbA6IPjuP/psmsexEtbUJN1jKiFRKMwmUdH8PnSkbqpIdWP7K/TRM/Q3IY9i4jjHe5bHy5IWQFBDWagSPE6k8FabGI3yJ3Md6e18yT9pOjwtpBWIAAEk= 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 1761037945304794.0579465911508; Tue, 21 Oct 2025 02:12:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8KN-0006bO-8c; Tue, 21 Oct 2025 05:06:47 -0400 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 1vB8KI-0006Tx-7l for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:42 -0400 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 1vB8K8-0004Kx-LK for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:41 -0400 Received: from mx-prod-mc-05.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-615-LXr6cZvVPt6z4InVfl5tIA-1; Tue, 21 Oct 2025 05:06:13 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 072491956096; Tue, 21 Oct 2025 09:06:12 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7E0431800451; Tue, 21 Oct 2025 09:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037591; 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=nmXqy4w9Xp3d871swaw2TtPMrWUPX5OISXyRJWRiPhU=; b=iYyxT/KvonWqrPAHFZ7zWTnCl9UI7e3vmORhzizcgXoJDi8Nb5/IYtMxMOxQzlQNByoFdI 37NdDPLSrlxMTpfrKHLrA8irBdlVPKag64Qp0F5/kcsD9zL9/SqvkoJqmu3N+KFg2atdhW CJeFJTh8Om5KChpwwrArfJWNBcpePFo= X-MC-Unique: LXr6cZvVPt6z4InVfl5tIA-1 X-Mimecast-MFC-AGG-ID: LXr6cZvVPt6z4InVfl5tIA_1761037572 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 31/43] hw/audio: replace AUD_log() usage Date: Tue, 21 Oct 2025 13:03:02 +0400 Message-ID: <20251021090317.425409-32-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URI_DOTEDU=1 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: 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: 1761037961660158500 From: Marc-Andr=C3=A9 Lureau AUD_log() is just printf(stderr, "prefix: "..), we can use error_report() or warn_report() appropriately instead. Ideally it should be converted to traces, but there are many places to convert, this is left for another day. Avoid bit-rot by using conditionals. The patch could be splitted if necessary. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/ac97.c | 120 ++++++++++++++++++++++----------------------- hw/audio/adlib.c | 20 +++----- hw/audio/cs4231a.c | 40 +++++++-------- hw/audio/es1370.c | 24 ++++----- hw/audio/gus.c | 21 ++++---- hw/audio/pcspk.c | 2 +- hw/audio/sb16.c | 93 +++++++++++++++++------------------ 7 files changed, 151 insertions(+), 169 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 9157588dbc..1b2ce601a6 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "system/dma.h" #include "qom/object.h" +#include "qemu/error-report.h" #include "ac97.h" =20 #define SOFT_VOLUME @@ -141,11 +142,8 @@ enum { BUP_LAST =3D 2 }; =20 -#ifdef DEBUG_AC97 -#define dolog(...) AUD_log("ac97", __VA_ARGS__) -#else -#define dolog(...) -#endif +#define DEBUG_AC97 0 +#define dolog(fmt, ...) do { if (DEBUG_AC97) error_report("ac97: " fmt, ##= __VA_ARGS__); } while (0) =20 #define MKREGS(prefix, start) \ enum { \ @@ -190,7 +188,7 @@ static void fetch_bd(AC97LinkState *s, AC97BusMasterReg= s *r) r->bd.addr =3D le32_to_cpu(*(uint32_t *) &b[0]) & ~3; r->bd.ctl_len =3D le32_to_cpu(*(uint32_t *) &b[4]); r->picb =3D r->bd.ctl_len & 0xffff; - dolog("bd %2d addr=3D0x%x ctl=3D0x%06x len=3D0x%x(%d bytes)\n", + dolog("bd %2d addr=3D0x%x ctl=3D0x%06x len=3D0x%x(%d bytes)", r->civ, r->bd.addr, r->bd.ctl_len >> 16, r->bd.ctl_len & 0xffff, (r->bd.ctl_len & 0xffff) << 1); } @@ -222,7 +220,7 @@ static void update_sr(AC97LinkState *s, AC97BusMasterRe= gs *r, uint32_t new_sr) =20 r->sr =3D new_sr; =20 - dolog("IOC%d LVB%d sr=3D0x%x event=3D%d level=3D%d\n", + dolog("IOC%d LVB%d sr=3D0x%x event=3D%d level=3D%d", r->sr & SR_BCIS, r->sr & SR_LVBCI, r->sr, event, level); =20 if (!event) { @@ -231,11 +229,11 @@ static void update_sr(AC97LinkState *s, AC97BusMaster= Regs *r, uint32_t new_sr) =20 if (level) { s->glob_sta |=3D masks[r - s->bm_regs]; - dolog("set irq level=3D1\n"); + dolog("set irq level=3D1"); pci_irq_assert(&s->dev); } else { s->glob_sta &=3D ~masks[r - s->bm_regs]; - dolog("set irq level=3D0\n"); + dolog("set irq level=3D0"); pci_irq_deassert(&s->dev); } } @@ -256,14 +254,14 @@ static void voice_set_active(AC97LinkState *s, int bm= _index, int on) break; =20 default: - AUD_log("ac97", "invalid bm_index(%d) in voice_set_active", bm_ind= ex); + error_report("ac97: invalid bm_index(%d) in voice_set_active", bm_= index); break; } } =20 static void reset_bm_regs(AC97LinkState *s, AC97BusMasterRegs *r) { - dolog("reset_bm_regs\n"); + dolog("reset_bm_regs"); r->bdbar =3D 0; r->civ =3D 0; r->lvi =3D 0; @@ -281,7 +279,7 @@ static void reset_bm_regs(AC97LinkState *s, AC97BusMast= erRegs *r) static void mixer_store(AC97LinkState *s, uint32_t i, uint16_t v) { if (i + 2 > sizeof(s->mixer_data)) { - dolog("mixer_store: index %d out of bounds %zd\n", + dolog("mixer_store: index %d out of bounds %zd", i, sizeof(s->mixer_data)); return; } @@ -295,7 +293,7 @@ static uint16_t mixer_load(AC97LinkState *s, uint32_t i) uint16_t val =3D 0xffff; =20 if (i + 2 > sizeof(s->mixer_data)) { - dolog("mixer_load: index %d out of bounds %zd\n", + dolog("mixer_load: index %d out of bounds %zd", i, sizeof(s->mixer_data)); } else { val =3D s->mixer_data[i + 0] | (s->mixer_data[i + 1] << 8); @@ -460,7 +458,7 @@ static void mixer_reset(AC97LinkState *s) { uint8_t active[LAST_INDEX]; =20 - dolog("mixer_reset\n"); + dolog("mixer_reset"); memset(s->mixer_data, 0, sizeof(s->mixer_data)); memset(active, 0, sizeof(active)); mixer_store(s, AC97_Reset, 0x0000); /* 6940 */ @@ -508,7 +506,7 @@ static void mixer_reset(AC97LinkState *s) static uint32_t nam_readb(void *opaque, uint32_t addr) { AC97LinkState *s =3D opaque; - dolog("U nam readb 0x%x\n", addr); + dolog("U nam readb 0x%x", addr); s->cas =3D 0; return ~0U; } @@ -523,7 +521,7 @@ static uint32_t nam_readw(void *opaque, uint32_t addr) static uint32_t nam_readl(void *opaque, uint32_t addr) { AC97LinkState *s =3D opaque; - dolog("U nam readl 0x%x\n", addr); + dolog("U nam readl 0x%x", addr); s->cas =3D 0; return ~0U; } @@ -535,7 +533,7 @@ static uint32_t nam_readl(void *opaque, uint32_t addr) static void nam_writeb(void *opaque, uint32_t addr, uint32_t val) { AC97LinkState *s =3D opaque; - dolog("U nam writeb 0x%x <- 0x%x\n", addr, val); + dolog("U nam writeb 0x%x <- 0x%x", addr, val); s->cas =3D 0; } =20 @@ -563,10 +561,10 @@ static void nam_writew(void *opaque, uint32_t addr, u= int32_t val) break; case AC97_Vendor_ID1: case AC97_Vendor_ID2: - dolog("Attempt to write vendor ID to 0x%x\n", val); + dolog("Attempt to write vendor ID to 0x%x", val); break; case AC97_Extended_Audio_ID: - dolog("Attempt to write extended audio ID to 0x%x\n", val); + dolog("Attempt to write extended audio ID to 0x%x", val); break; case AC97_Extended_Audio_Ctrl_Stat: if (!(val & EACS_VRA)) { @@ -579,36 +577,36 @@ static void nam_writew(void *opaque, uint32_t addr, u= int32_t val) mixer_store(s, AC97_MIC_ADC_Rate, 0xbb80); open_voice(s, MC_INDEX, 48000); } - dolog("Setting extended audio control to 0x%x\n", val); + dolog("Setting extended audio control to 0x%x", val); mixer_store(s, AC97_Extended_Audio_Ctrl_Stat, val); break; case AC97_PCM_Front_DAC_Rate: if (mixer_load(s, AC97_Extended_Audio_Ctrl_Stat) & EACS_VRA) { mixer_store(s, addr, val); - dolog("Set front DAC rate to %d\n", val); + dolog("Set front DAC rate to %d", val); open_voice(s, PO_INDEX, val); } else { - dolog("Attempt to set front DAC rate to %d, but VRA is not set= \n", + dolog("Attempt to set front DAC rate to %d, but VRA is not set= ", val); } break; case AC97_MIC_ADC_Rate: if (mixer_load(s, AC97_Extended_Audio_Ctrl_Stat) & EACS_VRM) { mixer_store(s, addr, val); - dolog("Set MIC ADC rate to %d\n", val); + dolog("Set MIC ADC rate to %d", val); open_voice(s, MC_INDEX, val); } else { - dolog("Attempt to set MIC ADC rate to %d, but VRM is not set\n= ", + dolog("Attempt to set MIC ADC rate to %d, but VRM is not set", val); } break; case AC97_PCM_LR_ADC_Rate: if (mixer_load(s, AC97_Extended_Audio_Ctrl_Stat) & EACS_VRA) { mixer_store(s, addr, val); - dolog("Set front LR ADC rate to %d\n", val); + dolog("Set front LR ADC rate to %d", val); open_voice(s, PI_INDEX, val); } else { - dolog("Attempt to set LR ADC rate to %d, but VRA is not set\n", + dolog("Attempt to set LR ADC rate to %d, but VRA is not set", val); } break; @@ -630,7 +628,7 @@ static void nam_writew(void *opaque, uint32_t addr, uin= t32_t val) /* None of the features in these regs are emulated, so they are RO= */ break; default: - dolog("U nam writew 0x%x <- 0x%x\n", addr, val); + dolog("U nam writew 0x%x <- 0x%x", addr, val); mixer_store(s, addr, val); break; } @@ -639,7 +637,7 @@ static void nam_writew(void *opaque, uint32_t addr, uin= t32_t val) static void nam_writel(void *opaque, uint32_t addr, uint32_t val) { AC97LinkState *s =3D opaque; - dolog("U nam writel 0x%x <- 0x%x\n", addr, val); + dolog("U nam writel 0x%x <- 0x%x", addr, val); s->cas =3D 0; } =20 @@ -655,7 +653,7 @@ static uint32_t nabm_readb(void *opaque, uint32_t addr) =20 switch (addr) { case CAS: - dolog("CAS %d\n", s->cas); + dolog("CAS %d", s->cas); val =3D s->cas; s->cas =3D 1; break; @@ -664,38 +662,38 @@ static uint32_t nabm_readb(void *opaque, uint32_t add= r) case MC_CIV: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->civ; - dolog("CIV[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("CIV[%d] -> 0x%x", GET_BM(addr), val); break; case PI_LVI: case PO_LVI: case MC_LVI: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->lvi; - dolog("LVI[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("LVI[%d] -> 0x%x", GET_BM(addr), val); break; case PI_PIV: case PO_PIV: case MC_PIV: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->piv; - dolog("PIV[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("PIV[%d] -> 0x%x", GET_BM(addr), val); break; case PI_CR: case PO_CR: case MC_CR: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->cr; - dolog("CR[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("CR[%d] -> 0x%x", GET_BM(addr), val); break; case PI_SR: case PO_SR: case MC_SR: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->sr & 0xff; - dolog("SRb[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("SRb[%d] -> 0x%x", GET_BM(addr), val); break; default: - dolog("U nabm readb 0x%x -> 0x%x\n", addr, val); + dolog("U nabm readb 0x%x -> 0x%x", addr, val); break; } return val; @@ -713,17 +711,17 @@ static uint32_t nabm_readw(void *opaque, uint32_t add= r) case MC_SR: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->sr; - dolog("SR[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("SR[%d] -> 0x%x", GET_BM(addr), val); break; case PI_PICB: case PO_PICB: case MC_PICB: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->picb; - dolog("PICB[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("PICB[%d] -> 0x%x", GET_BM(addr), val); break; default: - dolog("U nabm readw 0x%x -> 0x%x\n", addr, val); + dolog("U nabm readw 0x%x -> 0x%x", addr, val); break; } return val; @@ -741,14 +739,14 @@ static uint32_t nabm_readl(void *opaque, uint32_t add= r) case MC_BDBAR: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->bdbar; - dolog("BMADDR[%d] -> 0x%x\n", GET_BM(addr), val); + dolog("BMADDR[%d] -> 0x%x", GET_BM(addr), val); break; case PI_CIV: case PO_CIV: case MC_CIV: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->civ | (r->lvi << 8) | (r->sr << 16); - dolog("CIV LVI SR[%d] -> 0x%x, 0x%x, 0x%x\n", GET_BM(addr), + dolog("CIV LVI SR[%d] -> 0x%x, 0x%x, 0x%x", GET_BM(addr), r->civ, r->lvi, r->sr); break; case PI_PICB: @@ -756,19 +754,19 @@ static uint32_t nabm_readl(void *opaque, uint32_t add= r) case MC_PICB: r =3D &s->bm_regs[GET_BM(addr)]; val =3D r->picb | (r->piv << 16) | (r->cr << 24); - dolog("PICB PIV CR[%d] -> 0x%x 0x%x 0x%x 0x%x\n", GET_BM(addr), + dolog("PICB PIV CR[%d] -> 0x%x 0x%x 0x%x 0x%x", GET_BM(addr), val, r->picb, r->piv, r->cr); break; case GLOB_CNT: val =3D s->glob_cnt; - dolog("glob_cnt -> 0x%x\n", val); + dolog("glob_cnt -> 0x%x", val); break; case GLOB_STA: val =3D s->glob_sta | GS_S0CR; - dolog("glob_sta -> 0x%x\n", val); + dolog("glob_sta -> 0x%x", val); break; default: - dolog("U nabm readl 0x%x -> 0x%x\n", addr, val); + dolog("U nabm readl 0x%x -> 0x%x", addr, val); break; } return val; @@ -795,7 +793,7 @@ static void nabm_writeb(void *opaque, uint32_t addr, ui= nt32_t val) fetch_bd(s, r); } r->lvi =3D val % 32; - dolog("LVI[%d] <- 0x%x\n", GET_BM(addr), val); + dolog("LVI[%d] <- 0x%x", GET_BM(addr), val); break; case PI_CR: case PO_CR: @@ -816,7 +814,7 @@ static void nabm_writeb(void *opaque, uint32_t addr, ui= nt32_t val) voice_set_active(s, r - s->bm_regs, 1); } } - dolog("CR[%d] <- 0x%x (cr 0x%x)\n", GET_BM(addr), val, r->cr); + dolog("CR[%d] <- 0x%x (cr 0x%x)", GET_BM(addr), val, r->cr); break; case PI_SR: case PO_SR: @@ -824,10 +822,10 @@ static void nabm_writeb(void *opaque, uint32_t addr, = uint32_t val) r =3D &s->bm_regs[GET_BM(addr)]; r->sr |=3D val & ~(SR_RO_MASK | SR_WCLEAR_MASK); update_sr(s, r, r->sr & ~(val & SR_WCLEAR_MASK)); - dolog("SR[%d] <- 0x%x (sr 0x%x)\n", GET_BM(addr), val, r->sr); + dolog("SR[%d] <- 0x%x (sr 0x%x)", GET_BM(addr), val, r->sr); break; default: - dolog("U nabm writeb 0x%x <- 0x%x\n", addr, val); + dolog("U nabm writeb 0x%x <- 0x%x", addr, val); break; } } @@ -844,10 +842,10 @@ static void nabm_writew(void *opaque, uint32_t addr, = uint32_t val) r =3D &s->bm_regs[GET_BM(addr)]; r->sr |=3D val & ~(SR_RO_MASK | SR_WCLEAR_MASK); update_sr(s, r, r->sr & ~(val & SR_WCLEAR_MASK)); - dolog("SR[%d] <- 0x%x (sr 0x%x)\n", GET_BM(addr), val, r->sr); + dolog("SR[%d] <- 0x%x (sr 0x%x)", GET_BM(addr), val, r->sr); break; default: - dolog("U nabm writew 0x%x <- 0x%x\n", addr, val); + dolog("U nabm writew 0x%x <- 0x%x", addr, val); break; } } @@ -863,22 +861,22 @@ static void nabm_writel(void *opaque, uint32_t addr, = uint32_t val) case MC_BDBAR: r =3D &s->bm_regs[GET_BM(addr)]; r->bdbar =3D val & ~3; - dolog("BDBAR[%d] <- 0x%x (bdbar 0x%x)\n", GET_BM(addr), val, r->bd= bar); + dolog("BDBAR[%d] <- 0x%x (bdbar 0x%x)", GET_BM(addr), val, r->bdba= r); break; case GLOB_CNT: /* TODO: Handle WR or CR being set (warm/cold reset requests) */ if (!(val & (GC_WR | GC_CR))) { s->glob_cnt =3D val & GC_VALID_MASK; } - dolog("glob_cnt <- 0x%x (glob_cnt 0x%x)\n", val, s->glob_cnt); + dolog("glob_cnt <- 0x%x (glob_cnt 0x%x)", val, s->glob_cnt); break; case GLOB_STA: s->glob_sta &=3D ~(val & GS_WCLEAR_MASK); s->glob_sta |=3D (val & ~(GS_WCLEAR_MASK | GS_RO_MASK)) & GS_VALID= _MASK; - dolog("glob_sta <- 0x%x (glob_sta 0x%x)\n", val, s->glob_sta); + dolog("glob_sta <- 0x%x (glob_sta 0x%x)", val, s->glob_sta); break; default: - dolog("U nabm writel 0x%x <- 0x%x\n", addr, val); + dolog("U nabm writel 0x%x <- 0x%x", addr, val); break; } } @@ -903,7 +901,7 @@ static int write_audio(AC97LinkState *s, AC97BusMasterR= egs *r, to_copy =3D MIN(temp, sizeof(tmpbuf)); pci_dma_read(&s->dev, addr, tmpbuf, to_copy); copied =3D AUD_write(s->voice_po, tmpbuf, to_copy); - dolog("write_audio max=3D%x to_copy=3D%x copied=3D%x\n", + dolog("write_audio max=3D%x to_copy=3D%x copied=3D%x", max, to_copy, copied); if (!copied) { *stop =3D 1; @@ -916,7 +914,7 @@ static int write_audio(AC97LinkState *s, AC97BusMasterR= egs *r, =20 if (!temp) { if (to_copy < 4) { - dolog("whoops\n"); + dolog("whoops"); s->last_samp =3D 0; } else { s->last_samp =3D *(uint32_t *)&tmpbuf[to_copy - 4]; @@ -929,7 +927,7 @@ static int write_audio(AC97LinkState *s, AC97BusMasterR= egs *r, =20 static void write_bup(AC97LinkState *s, int elapsed) { - dolog("write_bup\n"); + dolog("write_bup"); if (!(s->bup_flag & BUP_SET)) { if (s->bup_flag & BUP_LAST) { int i; @@ -997,7 +995,7 @@ static void transfer_audio(AC97LinkState *s, int index,= int elapsed) int stop =3D 0; =20 if (s->invalid_freq[index]) { - AUD_log("ac97", "attempt to use voice %d with invalid frequency %d= \n", + error_report("ac97: attempt to use voice %d with invalid frequency= %d", index, s->invalid_freq[index]); return; } @@ -1017,12 +1015,12 @@ static void transfer_audio(AC97LinkState *s, int in= dex, int elapsed) int temp; =20 if (!r->bd_valid) { - dolog("invalid bd\n"); + dolog("invalid bd"); fetch_bd(s, r); } =20 if (!r->picb) { - dolog("fresh bd %d is empty 0x%x 0x%x\n", + dolog("fresh bd %d is empty 0x%x 0x%x", r->civ, r->bd.addr, r->bd.ctl_len); if (r->civ =3D=3D r->lvi) { r->sr |=3D SR_DCH; /* CELV? */ @@ -1059,7 +1057,7 @@ static void transfer_audio(AC97LinkState *s, int inde= x, int elapsed) } =20 if (r->civ =3D=3D r->lvi) { - dolog("Underrun civ (%d) =3D=3D lvi (%d)\n", r->civ, r->lv= i); + dolog("Underrun civ (%d) =3D=3D lvi (%d)", r->civ, r->lvi); =20 new_sr |=3D SR_LVBCI | SR_DCH | SR_CELV; stop =3D 1; diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 50bbb97a56..231055b8b5 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -29,24 +29,20 @@ #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" +#include "qemu/error-report.h" #include "qom/object.h" =20 -//#define DEBUG +#define DEBUG 0 =20 #define ADLIB_KILL_TIMERS 1 =20 #define ADLIB_DESC "Yamaha YM3812 (OPL2)" =20 -#ifdef DEBUG +#if DEBUG #include "qemu/timer.h" #endif =20 -#define dolog(...) AUD_log ("adlib", __VA_ARGS__) -#ifdef DEBUG -#define ldebug(...) dolog (__VA_ARGS__) -#else -#define ldebug(...) -#endif +#define ldebug(fmt, ...) do { if (DEBUG) error_report("adlib: " fmt, ##__V= A_ARGS__); } while(0) =20 #include "fmopl.h" #define SHIFT 1 @@ -64,7 +60,7 @@ struct AdlibState { int enabled; int active; int bufpos; -#ifdef DEBUG +#if DEBUG int64_t exp[2]; #endif int16_t *mixbuf; @@ -92,7 +88,7 @@ static void adlib_kill_timers (AdlibState *s) =20 delta =3D AUD_get_elapsed_usec_out (s->voice, &s->ats); ldebug ( - "delta =3D %f dexp =3D %f expired =3D> %d\n", + "delta =3D %f dexp =3D %f expired =3D> %d", delta / 1000000.0, s->dexp[i] / 1000000.0, delta >=3D s->dexp[i] @@ -131,7 +127,7 @@ static void timer_handler (void *opaque, int c, double = interval_Sec) { AdlibState *s =3D opaque; unsigned n =3D c & 1; -#ifdef DEBUG +#if DEBUG double interval; int64_t exp; #endif @@ -142,7 +138,7 @@ static void timer_handler (void *opaque, int c, double = interval_Sec) } =20 s->ticking[n] =3D 1; -#ifdef DEBUG +#if DEBUG interval =3D NANOSECONDS_PER_SECOND * interval_Sec; exp =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + interval; s->exp[n] =3D exp; diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index c8837fe269..062af7628b 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -30,7 +30,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/module.h" -#include "qemu/timer.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qom/object.h" =20 @@ -43,21 +43,17 @@ More... */ =20 -/* #define DEBUG */ +#define DEBUG 0 /* #define DEBUG_XLAW */ =20 static struct { int aci_counter; } conf =3D {1}; =20 -#ifdef DEBUG -#define dolog(...) AUD_log ("cs4231a", __VA_ARGS__) -#else -#define dolog(...) -#endif +#define dolog(fmt, ...) do { if (DEBUG) error_report("cs4231a: " fmt, ##__= VA_ARGS__); } while(0) =20 -#define lwarn(...) AUD_log ("cs4231a", "warning: " __VA_ARGS__) -#define lerr(...) AUD_log ("cs4231a", "error: " __VA_ARGS__) +#define lwarn(fmt, ...) warn_report("cs4231a: " fmt, ##__VA_ARGS__) +#define lerr(fmt, ...) error_report("cs4231a: " fmt, ##__VA_ARGS__) =20 #define CS_REGS 16 #define CS_DREGS 32 @@ -284,7 +280,7 @@ static void cs_reset_voices (CSState *s, uint32_t val) as.freq =3D freqs[xtal][(val >> 1) & 7]; =20 if (as.freq =3D=3D -1) { - lerr ("unsupported frequency (val=3D%#x)\n", val); + lerr ("unsupported frequency (val=3D%#x)", val); goto error; } =20 @@ -319,11 +315,11 @@ static void cs_reset_voices (CSState *s, uint32_t val) =20 case 7: case 4: - lerr ("attempt to use reserved format value (%#x)\n", val); + lerr ("attempt to use reserved format value (%#x)", val); goto error; =20 case 5: - lerr ("ADPCM 4 bit IMA compatible format is not supported\n"); + lerr ("ADPCM 4 bit IMA compatible format is not supported"); goto error; } =20 @@ -393,7 +389,7 @@ static uint64_t cs_read (void *opaque, hwaddr addr, uns= igned size) ret =3D s->regs[saddr]; break; } - dolog ("read %d:%d -> %d\n", saddr, iaddr, ret); + dolog ("read %d:%d -> %d", saddr, iaddr, ret); return ret; } =20 @@ -425,7 +421,7 @@ static void cs_write (void *opaque, hwaddr addr, case RESERVED: case RESERVED_2: case RESERVED_3: - lwarn ("attempt to write %#x to reserved indirect register %d\= n", + lwarn ("attempt to write %#x to reserved indirect register %d", val, iaddr); break; =20 @@ -439,7 +435,7 @@ static void cs_write (void *opaque, hwaddr addr, cs_reset_voices (s, val); } else { - lwarn ("[P]MCE(%#x, %#x) is not set, val=3D%#x\n", + lwarn ("[P]MCE(%#x, %#x) is not set, val=3D%#x", s->regs[Index_Address], s->dregs[Alternate_Feature_Status], val); @@ -453,7 +449,7 @@ static void cs_write (void *opaque, hwaddr addr, val &=3D ~(1 << 5); /* D5 is reserved */ s->dregs[iaddr] =3D val; if (val & PPIO) { - lwarn ("PIO is not supported (%#x)\n", val); + lwarn ("PIO is not supported (%#x)", val); break; } if (val & PEN) { @@ -472,11 +468,11 @@ static void cs_write (void *opaque, hwaddr addr, break; =20 case Error_Status_And_Initialization: - lwarn ("attempt to write to read only register %d\n", iaddr); + lwarn ("attempt to write to read only register %d", iaddr); break; =20 case MODE_And_ID: - dolog ("val=3D%#x\n", val); + dolog ("val=3D%#x", val); if (val & MODE2) s->dregs[iaddr] |=3D MODE2; else @@ -485,7 +481,7 @@ static void cs_write (void *opaque, hwaddr addr, =20 case Alternate_Feature_Enable_I: if (val & TE) - lerr ("timer is not yet supported\n"); + lerr ("timer is not yet supported"); s->dregs[iaddr] =3D val; break; =20 @@ -499,7 +495,7 @@ static void cs_write (void *opaque, hwaddr addr, break; =20 case Version_Chip_ID: - lwarn ("write to Version_Chip_ID register %#x\n", val); + lwarn ("write to Version_Chip_ID register %#x", val); s->dregs[iaddr] =3D val; break; =20 @@ -507,7 +503,7 @@ static void cs_write (void *opaque, hwaddr addr, s->dregs[iaddr] =3D val; break; } - dolog ("written value %#x to indirect register %d\n", val, iaddr); + dolog ("written value %#x to indirect register %d", val, iaddr); break; =20 case Status: @@ -519,7 +515,7 @@ static void cs_write (void *opaque, hwaddr addr, break; =20 case PIO_Data: - lwarn ("attempt to write value %#x to PIO register\n", val); + lwarn ("attempt to write value %#x to PIO register", val); break; } } diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 8cb47589c3..ac5a6aba85 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -32,7 +32,7 @@ #include "migration/vmstate.h" #include "qemu/cutils.h" #include "qemu/module.h" -#include "system/dma.h" +#include "qemu/error-report.h" #include "qom/object.h" #include "trace.h" =20 @@ -190,7 +190,7 @@ static void print_ctl(uint32_t val) a(CDC_EN); a(SERR_DIS); #undef a - AUD_log("es1370", "ctl - PCLKDIV %d(DAC2 freq %d), freq %d,%s\n", + error_report("es1370: ctl - PCLKDIV %d(DAC2 freq %d), freq %d,%s\n= ", (val & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV, DAC2_DIVTOSR((val & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), dac1_samplerate[(val & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], @@ -226,7 +226,7 @@ static void print_sctl(uint32_t val) } #undef b #undef a - AUD_log("es1370", + error_report("es1370: " "%s p2_end_inc %d, p2_st_inc %d," " r1_fmt %s, p2_fmt %s, p1_fmt %s\n", buf, @@ -238,10 +238,10 @@ static void print_sctl(uint32_t val) } } =20 -#define lwarn(...) \ +#define lwarn(fmt, ...) \ do { \ if (VERBOSE_ES1370) { \ - AUD_log("es1370: warning", __VA_ARGS__); \ + error_report("es1370: " fmt, ##__VA_ARGS__); \ } \ } while (0) =20 @@ -502,10 +502,10 @@ static void es1370_write(void *opaque, hwaddr addr, u= int64_t val, unsigned size) break; =20 case ES1370_REG_PHANTOM_FRAMECNT: - lwarn("writing to phantom frame count 0x%" PRIx64 "\n", val); + lwarn("writing to phantom frame count 0x%" PRIx64, val); break; case ES1370_REG_PHANTOM_FRAMEADR: - lwarn("writing to phantom frame address 0x%" PRIx64 "\n", val); + lwarn("writing to phantom frame address 0x%" PRIx64, val); break; =20 case ES1370_REG_ADC_FRAMECNT: @@ -522,7 +522,7 @@ static void es1370_write(void *opaque, hwaddr addr, uin= t64_t val, unsigned size) break; =20 default: - lwarn("writel 0x%" PRIx64 " <- 0x%" PRIx64 "\n", addr, val); + lwarn("writel 0x%" PRIx64 " <- 0x%" PRIx64, addr, val); break; } } @@ -586,16 +586,16 @@ static uint64_t es1370_read(void *opaque, hwaddr addr= , unsigned size) =20 case ES1370_REG_PHANTOM_FRAMECNT: val =3D ~0U; - lwarn("reading from phantom frame count\n"); + lwarn("reading from phantom frame count"); break; case ES1370_REG_PHANTOM_FRAMEADR: val =3D ~0U; - lwarn("reading from phantom frame address\n"); + lwarn("reading from phantom frame address"); break; =20 default: val =3D ~0U; - lwarn("readl 0x%" PRIx64 " -> 0x%x\n", addr, val); + lwarn("readl 0x%" PRIx64 " -> 0x%x", addr, val); break; } return val; @@ -677,7 +677,7 @@ static void es1370_transfer_audio (ES1370State *s, stru= ct chan *d, int loop_sel, * when the sample count reaches zero) or 1 for stop mode (set * interrupt and stop recording). */ - AUD_log ("es1370: warning", "non looping mode\n"); + warn_report("es1370: non looping mode"); } else { d->frame_cnt =3D size; =20 diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 2c84740adf..40073f2d4f 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -32,15 +32,12 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "gusemu.h" -#include "gustate.h" +#include "qemu/error-report.h" #include "qom/object.h" =20 -#define dolog(...) AUD_log ("audio", __VA_ARGS__) -#ifdef DEBUG -#define ldebug(...) dolog (__VA_ARGS__) -#else -#define ldebug(...) -#endif +#define DEBUG 0 + +#define ldebug(fmt, ...) do { if (DEBUG) error_report("gus: " fmt, ##__VA_= ARGS__); } while (0) =20 #define TYPE_GUS "gus" OBJECT_DECLARE_SIMPLE_TYPE(GUSState, GUS) @@ -154,14 +151,14 @@ int GUS_irqrequest (GUSEmuState *emu, int hwirq, int = n) /* qemu_irq_lower (s->pic); */ qemu_irq_raise (s->pic); s->irqs +=3D n; - ldebug ("irqrequest %d %d %d\n", hwirq, n, s->irqs); + ldebug("irqrequest %d %d %d", hwirq, n, s->irqs); return n; } =20 void GUS_irqclear (GUSEmuState *emu, int hwirq) { GUSState *s =3D emu->opaque; - ldebug ("irqclear %d %d\n", hwirq, s->irqs); + ldebug("irqclear %d %d", hwirq, s->irqs); qemu_irq_lower (s->pic); s->irqs -=3D 1; #ifdef IRQ_STORM @@ -175,7 +172,7 @@ void GUS_dmarequest (GUSEmuState *emu) { GUSState *s =3D emu->opaque; IsaDmaClass *k =3D ISADMA_GET_CLASS(s->isa_dma); - ldebug ("dma request %d\n", der->gusdma); + ldebug("dma request %d", s->emu.gusdma); k->hold_DREQ(s->isa_dma, s->emu.gusdma); } =20 @@ -186,13 +183,13 @@ static int GUS_read_DMA (void *opaque, int nchan, int= dma_pos, int dma_len) QEMU_UNINITIALIZED char tmpbuf[4096]; int pos =3D dma_pos, mode, left =3D dma_len - dma_pos; =20 - ldebug ("read DMA %#x %d\n", dma_pos, dma_len); + ldebug("read DMA %#x %d", dma_pos, dma_len); mode =3D k->has_autoinitialization(s->isa_dma, s->emu.gusdma); while (left) { int to_copy =3D MIN ((size_t) left, sizeof (tmpbuf)); int copied; =20 - ldebug ("left=3D%d to_copy=3D%d pos=3D%d\n", left, to_copy, pos); + ldebug("left=3D%d to_copy=3D%d pos=3D%d", left, to_copy, pos); copied =3D k->read_memory(s->isa_dma, nchan, tmpbuf, pos, to_copy); gus_dma_transferdata (&s->emu, tmpbuf, copied, left =3D=3D copied); left -=3D copied; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 12a214c566..c8c63b7915 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -124,7 +124,7 @@ static int pcspk_audio_init(PCSpkState *s) =20 s->voice =3D AUD_open_out(&s->card, s->voice, s_spk, s, pcspk_callback= , &as); if (!s->voice) { - AUD_log(s_spk, "Could not open voice\n"); + error_report("pcspk: Could not open voice"); return -1; } =20 diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index cd7e813d05..069cf6e120 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -30,22 +30,17 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/timer.h" +#include "qemu/error-report.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" #include "qom/object.h" =20 -#define dolog(...) AUD_log ("sb16", __VA_ARGS__) - -/* #define DEBUG */ +#define DEBUG 0 /* #define DEBUG_SB16_MOST */ =20 -#ifdef DEBUG -#define ldebug(...) dolog (__VA_ARGS__) -#else -#define ldebug(...) -#endif +#define ldebug(fmt, ...) do { if (DEBUG) error_report("sb16: " fmt, ##__VA= _ARGS__); } while (0) =20 static const char e3[] =3D "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; =20 @@ -157,7 +152,7 @@ static int irq_of_magic (int magic) #if 0 static void log_dsp (SB16State *dsp) { - ldebug ("%s:%s:%d:%s:dmasize=3D%d:freq=3D%d:const=3D%d:speaker=3D%d\n", + ldebug ("%s:%s:%d:%s:dmasize=3D%d:freq=3D%d:const=3D%d:speaker=3D%d", dsp->fmt_stereo ? "Stereo" : "Mono", dsp->fmt_signed ? "Signed" : "Unsigned", dsp->fmt_bits, @@ -182,7 +177,7 @@ static void control (SB16State *s, int hold) IsaDmaClass *k =3D ISADMA_GET_CLASS(isa_dma); s->dma_running =3D hold; =20 - ldebug ("hold %d high %d dma %d\n", hold, s->use_hdma, dma); + ldebug ("hold %d high %d dma %d", hold, s->use_hdma, dma); =20 if (hold) { k->hold_DREQ(isa_dma, dma); @@ -290,7 +285,7 @@ static void dma_cmd8 (SB16State *s, int mask, int dma_l= en) } =20 ldebug ("freq %d, stereo %d, sign %d, bits %d, " - "dma %d, auto %d, fifo %d, high %d\n", + "dma %d, auto %d, fifo %d, high %d", s->freq, s->fmt_stereo, s->fmt_signed, s->fmt_bits, s->block_size, s->dma_auto, s->fifo, s->highspeed); =20 @@ -338,7 +333,7 @@ static void dma_cmd (SB16State *s, uint8_t cmd, uint8_t= d0, int dma_len) } =20 ldebug ("freq %d, stereo %d, sign %d, bits %d, " - "dma %d, auto %d, fifo %d, high %d\n", + "dma %d, auto %d, fifo %d, high %d", s->freq, s->fmt_stereo, s->fmt_signed, s->fmt_bits, s->block_size, s->dma_auto, s->fifo, s->highspeed); =20 @@ -395,7 +390,7 @@ static void dma_cmd (SB16State *s, uint8_t cmd, uint8_t= d0, int dma_len) =20 static inline void dsp_out_data (SB16State *s, uint8_t val) { - ldebug ("outdata %#x\n", val); + ldebug ("outdata %#x", val); if ((size_t) s->out_data_len < sizeof (s->out_data)) { s->out_data[s->out_data_len++] =3D val; } @@ -407,14 +402,14 @@ static inline uint8_t dsp_get_data (SB16State *s) return s->in2_data[--s->in_index]; } else { - dolog ("buffer underflow\n"); + warn_report("sb16: buffer underflow"); return 0; } } =20 static void command (SB16State *s, uint8_t cmd) { - ldebug ("command %#x\n", cmd); + ldebug ("command %#x", cmd); =20 if (cmd > 0xaf && cmd < 0xd0) { if (cmd & 8) { @@ -651,7 +646,7 @@ static void command (SB16State *s, uint8_t cmd) } =20 if (!s->needed_bytes) { - ldebug ("\n"); + ldebug ("!needed_bytes"); } =20 exit: @@ -687,7 +682,7 @@ static uint16_t dsp_get_hilo (SB16State *s) static void complete (SB16State *s) { int d0, d1, d2; - ldebug ("complete command %#x, in_index %d, needed_bytes %d\n", + ldebug ("complete command %#x, in_index %d, needed_bytes %d", s->cmd, s->in_index, s->needed_bytes); =20 if (s->cmd > 0xaf && s->cmd < 0xd0) { @@ -696,11 +691,11 @@ static void complete (SB16State *s) d0 =3D dsp_get_data (s); =20 if (s->cmd & 8) { - dolog ("ADC params cmd =3D %#x d0 =3D %d, d1 =3D %d, d2 =3D %d= \n", + warn_report("sb16: ADC params cmd =3D %#x d0 =3D %d, d1 =3D %d= , d2 =3D %d", s->cmd, d0, d1, d2); } else { - ldebug ("cmd =3D %#x d0 =3D %d, d1 =3D %d, d2 =3D %d\n", + ldebug ("cmd =3D %#x d0 =3D %d, d1 =3D %d, d2 =3D %d", s->cmd, d0, d1, d2); dma_cmd (s, s->cmd, d0, d1 + (d2 << 8)); } @@ -711,13 +706,13 @@ static void complete (SB16State *s) s->csp_mode =3D dsp_get_data (s); s->csp_reg83r =3D 0; s->csp_reg83w =3D 0; - ldebug ("CSP command 0x04: mode=3D%#x\n", s->csp_mode); + ldebug ("CSP command 0x04: mode=3D%#x", s->csp_mode); break; =20 case 0x05: s->csp_param =3D dsp_get_data (s); s->csp_value =3D dsp_get_data (s); - ldebug ("CSP command 0x05: param=3D%#x value=3D%#x\n", + ldebug ("CSP command 0x05: param=3D%#x value=3D%#x", s->csp_param, s->csp_value); break; @@ -725,9 +720,9 @@ static void complete (SB16State *s) case 0x0e: d0 =3D dsp_get_data (s); d1 =3D dsp_get_data (s); - ldebug ("write CSP register %d <- %#x\n", d1, d0); + ldebug ("write CSP register %d <- %#x", d1, d0); if (d1 =3D=3D 0x83) { - ldebug ("0x83[%d] <- %#x\n", s->csp_reg83r, d0); + ldebug ("0x83[%d] <- %#x", s->csp_reg83r, d0); s->csp_reg83[s->csp_reg83r % 4] =3D d0; s->csp_reg83r +=3D 1; } @@ -738,10 +733,10 @@ static void complete (SB16State *s) =20 case 0x0f: d0 =3D dsp_get_data (s); - ldebug ("read CSP register %#x -> %#x, mode=3D%#x\n", + ldebug ("read CSP register %#x -> %#x, mode=3D%#x", d0, s->csp_regs[d0], s->csp_mode); if (d0 =3D=3D 0x83) { - ldebug ("0x83[%d] -> %#x\n", + ldebug ("0x83[%d] -> %#x", s->csp_reg83w, s->csp_reg83[s->csp_reg83w % 4]); dsp_out_data (s, s->csp_reg83[s->csp_reg83w % 4]); @@ -754,7 +749,7 @@ static void complete (SB16State *s) =20 case 0x10: d0 =3D dsp_get_data (s); - dolog ("cmd 0x10 d0=3D%#x\n", d0); + warn_report("sb16: cmd 0x10 d0=3D%#x\n", d0); break; =20 case 0x14: @@ -763,7 +758,7 @@ static void complete (SB16State *s) =20 case 0x40: s->time_const =3D dsp_get_data (s); - ldebug ("set time const %d\n", s->time_const); + ldebug ("set time const %d", s->time_const); break; =20 case 0x41: @@ -776,12 +771,12 @@ static void complete (SB16State *s) * http://homepages.cae.wisc.edu/~brodskye/sb16doc/sb16doc.htm= l#SamplingRate */ s->freq =3D restrict_sampling_rate(dsp_get_hilo(s)); - ldebug ("set freq %d\n", s->freq); + ldebug ("set freq %d", s->freq); break; =20 case 0x48: s->block_size =3D dsp_get_lohi (s) + 1; - ldebug ("set dma block len %d\n", s->block_size); + ldebug ("set dma block len %d", s->block_size); break; =20 case 0x74: @@ -811,21 +806,21 @@ static void complete (SB16State *s) ); } } - ldebug ("mix silence %d %d %" PRId64 "\n", samples, bytes,= ticks); + ldebug ("mix silence %d %d %" PRId64, samples, bytes, tick= s); } break; =20 case 0xe0: d0 =3D dsp_get_data (s); s->out_data_len =3D 0; - ldebug ("E0 data =3D %#x\n", d0); + ldebug ("E0 data =3D %#x", d0); dsp_out_data (s, ~d0); break; =20 case 0xe2: -#ifdef DEBUG +#if DEBUG d0 =3D dsp_get_data (s); - dolog ("E2 =3D %#x\n", d0); + warn_report("sb16: E2 =3D %#x", d0); #endif break; =20 @@ -835,7 +830,7 @@ static void complete (SB16State *s) =20 case 0xf9: d0 =3D dsp_get_data (s); - ldebug ("command 0xf9 with %#x\n", d0); + ldebug ("command 0xf9 with %#x", d0); switch (d0) { case 0x0e: dsp_out_data (s, 0xff); @@ -862,7 +857,7 @@ static void complete (SB16State *s) } } =20 - ldebug ("\n"); + ldebug (""); s->cmd =3D -1; } =20 @@ -926,7 +921,7 @@ static void dsp_write(void *opaque, uint32_t nport, uin= t32_t val) =20 iport =3D nport - s->port; =20 - ldebug ("write %#x <- %#x\n", nport, val); + ldebug ("write %#x <- %#x", nport, val); switch (iport) { case 0x06: switch (val) { @@ -976,7 +971,7 @@ static void dsp_write(void *opaque, uint32_t nport, uin= t32_t val) } else { if (s->in_index =3D=3D sizeof (s->in2_data)) { - dolog ("in data overrun\n"); + warn_report("sb16: in data overrun"); } else { s->in2_data[s->in_index++] =3D val; @@ -992,7 +987,7 @@ static void dsp_write(void *opaque, uint32_t nport, uin= t32_t val) break; =20 default: - ldebug ("(nport=3D%#x, val=3D%#x)\n", nport, val); + ldebug ("(nport=3D%#x, val=3D%#x)", nport, val); break; } } @@ -1016,7 +1011,7 @@ static uint32_t dsp_read(void *opaque, uint32_t nport) } else { if (s->cmd !=3D -1) { - dolog ("empty output buffer for command %#x\n", + warn_report("sb16: empty output buffer for command %#x", s->cmd); } retval =3D s->last_read_byte; @@ -1029,7 +1024,7 @@ static uint32_t dsp_read(void *opaque, uint32_t nport) break; =20 case 0x0d: /* timer interrupt clear */ - /* dolog ("timer interrupt clear\n"); */ + /* warn_report("sb16: timer interrupt clear"); */ retval =3D 0; break; =20 @@ -1056,13 +1051,13 @@ static uint32_t dsp_read(void *opaque, uint32_t npo= rt) } =20 if (!ack) { - ldebug ("read %#x -> %#x\n", nport, retval); + ldebug ("read %#x -> %#x", nport, retval); } =20 return retval; =20 error: - dolog ("warning: dsp_read %#x error\n", nport); + warn_report("sb16: dsp_read %#x error", nport); return 0xff; } =20 @@ -1108,7 +1103,7 @@ static void mixer_write_datab(void *opaque, uint32_t = nport, uint32_t val) SB16State *s =3D opaque; =20 (void) nport; - ldebug ("mixer_write [%#x] <- %#x\n", s->mixer_nreg, val); + ldebug ("mixer_write [%#x] <- %#x", s->mixer_nreg, val); =20 switch (s->mixer_nreg) { case 0x00: @@ -1118,7 +1113,7 @@ static void mixer_write_datab(void *opaque, uint32_t = nport, uint32_t val) case 0x80: { int irq =3D irq_of_magic (val); - ldebug ("setting irq to %d (val=3D%#x)\n", irq, val); + ldebug ("setting irq to %d (val=3D%#x)", irq, val); if (irq > 0) { s->irq =3D irq; } @@ -1150,7 +1145,7 @@ static void mixer_write_datab(void *opaque, uint32_t = nport, uint32_t val) =20 default: if (s->mixer_nreg >=3D 0x80) { - ldebug ("attempt to write mixer[%#x] <- %#x\n", s->mixer_nreg,= val); + ldebug ("attempt to write mixer[%#x] <- %#x", s->mixer_nreg, v= al); } break; } @@ -1165,11 +1160,11 @@ static uint32_t mixer_read(void *opaque, uint32_t n= port) (void) nport; #ifndef DEBUG_SB16_MOST if (s->mixer_nreg !=3D 0x82) { - ldebug ("mixer_read[%#x] -> %#x\n", + ldebug ("mixer_read[%#x] -> %#x", s->mixer_nreg, s->mixer_regs[s->mixer_nreg]); } #else - ldebug ("mixer_read[%#x] -> %#x\n", + ldebug ("mixer_read[%#x] -> %#x", s->mixer_nreg, s->mixer_regs[s->mixer_nreg]); #endif return s->mixer_regs[s->mixer_nreg]; @@ -1241,7 +1236,7 @@ static int SB_read_DMA (void *opaque, int nchan, int = dma_pos, int dma_len) till =3D s->left_till_irq; =20 #ifdef DEBUG_SB16_MOST - dolog ("pos:%06d %d till:%d len:%d\n", + warn_report("sb16: pos:%06d %d till:%d len:%d", dma_pos, free, till, dma_len); #endif =20 @@ -1265,7 +1260,7 @@ static int SB_read_DMA (void *opaque, int nchan, int = dma_pos, int dma_len) } =20 #ifdef DEBUG_SB16_MOST - ldebug ("pos %5d free %5d size %5d till % 5d copy %5d written %5d size= %5d\n", + ldebug ("pos %5d free %5d size %5d till % 5d copy %5d written %5d size= %5d", dma_pos, free, dma_len, s->left_till_irq, copy, written, s->block_size); #endif --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037796; cv=none; d=zohomail.com; s=zohoarc; b=EJpVN2W8dqVIZn4HKCnFWJgc8EcRMZvU8tdvZHX92Ve94zgAyh8zXhWg0urBkafN19ZiliAabO4wRUQxCZ5V3pBhE1Z0DhgFkc5LFvUsORMGIvwYxh8lYIfPBRbkcCb7WrBj9cWnDLBJ9zVgAE+M5yCKHohB6S59Zp/6g58HkfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037796; 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=VzFM6K+2i7h+oNqF0yTuFsdwjQeerBS1CLICsldsYVo=; b=Ye67t5gExaP4mkZI6Q7DWMfQqnGWs6m+tJuSRg570Cy5hxRAhH1DLYNmW3DGYd+/cpWOR3L7+XGNsCyw1PwbchkQgo/YoiAC08xiWX5mwo3qyZonqKEy6H7PBuiYIRRw3rQX7xbfU4yMelI0IPLRos12lOWiQSzehl+A7T6bRQE= 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 1761037796347912.9663720632009; Tue, 21 Oct 2025 02:09:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8K3-0005Nn-6S; Tue, 21 Oct 2025 05:06:27 -0400 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 1vB8K0-0005HP-RD for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:25 -0400 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 1vB8Jx-0004Ii-He for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:24 -0400 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-693-hIrKYDefPqq5Y5K9F5s6tQ-1; Tue, 21 Oct 2025 05:06:18 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 6C664195606D; Tue, 21 Oct 2025 09:06:17 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 299831800451; Tue, 21 Oct 2025 09:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037579; 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=VzFM6K+2i7h+oNqF0yTuFsdwjQeerBS1CLICsldsYVo=; b=CCToTSCMNOPHIErQkZGvGHfvOO4nChOcD8jnJLYOaffJM5fM5tHff+Di5DKPn7Mr1iOB0J l0AI4Olyyg9LU/RpIc+cR+dLwgAlVxSulAy13fGkkrcRFFIkweiJTcHhT+tbgaBnKR3HTf 4zYJEPnAVaviJUg2wBNiqc4yhegcZzA= X-MC-Unique: hIrKYDefPqq5Y5K9F5s6tQ-1 X-Mimecast-MFC-AGG-ID: hIrKYDefPqq5Y5K9F5s6tQ_1761037577 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 32/43] audio/replay: fix type punning Date: Tue, 21 Oct 2025 13:03:03 +0400 Message-ID: <20251021090317.425409-33-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037798025154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 6 ++++-- audio/mixeng.h | 1 - include/system/replay.h | 3 ++- audio/mixeng.c | 6 ++---- replay/replay-audio.c | 2 +- replay/stubs-system.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 88ca0a0660..91e8a4f23d 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -161,9 +161,11 @@ int wav_start_capture(AudioState *state, CaptureState = *s, const char *path, =20 void audio_cleanup(void); =20 -void audio_sample_to_uint64(const void *samples, int pos, +typedef struct st_sample st_sample; + +void audio_sample_to_uint64(const st_sample *sample, int pos, uint64_t *left, uint64_t *right); -void audio_sample_from_uint64(void *samples, int pos, +void audio_sample_from_uint64(st_sample *sample, int pos, uint64_t left, uint64_t right); =20 void audio_add_audiodev(Audiodev *audio); diff --git a/audio/mixeng.h b/audio/mixeng.h index ead93ac2f7..f63283f408 100644 --- a/audio/mixeng.h +++ b/audio/mixeng.h @@ -33,7 +33,6 @@ struct st_sample { mixeng_real l; mixeng_real r; }; struct mixeng_volume { int mute; int64_t r; int64_t l; }; struct st_sample { int64_t l; int64_t r; }; #endif -typedef struct st_sample st_sample; =20 typedef void (t_sample) (struct st_sample *dst, const void *src, int sampl= es); typedef void (f_sample) (void *dst, const struct st_sample *src, int sampl= es); diff --git a/include/system/replay.h b/include/system/replay.h index 1c87c97fdd..1e63c0784c 100644 --- a/include/system/replay.h +++ b/include/system/replay.h @@ -16,6 +16,7 @@ #include "qapi/qapi-types-run-state.h" #include "qapi/qapi-types-ui.h" #include "block/aio.h" +#include "audio/audio.h" =20 /* replay clock kinds */ enum ReplayClockKind { @@ -165,7 +166,7 @@ void replay_net_packet_event(ReplayNetState *rns, unsig= ned flags, /*! Saves/restores number of played samples of audio out operation. */ void replay_audio_out(size_t *played); /*! Saves/restores recorded samples of audio in operation. */ -void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t= size); +void replay_audio_in(size_t *recorded, st_sample *samples, size_t *wpos, s= ize_t size); =20 /* VM state operations */ =20 diff --git a/audio/mixeng.c b/audio/mixeng.c index be38617e9b..af9ec3d4d2 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -404,7 +404,7 @@ f_sample *mixeng_clip_float[2][2] =3D { } }; =20 -void audio_sample_to_uint64(const void *samples, int pos, +void audio_sample_to_uint64(const st_sample *sample, int pos, uint64_t *left, uint64_t *right) { #ifdef FLOAT_MIXENG @@ -412,14 +412,13 @@ void audio_sample_to_uint64(const void *samples, int = pos, "Coreaudio and floating point samples are not supported by replay = yet"); abort(); #else - const struct st_sample *sample =3D samples; sample +=3D pos; *left =3D sample->l; *right =3D sample->r; #endif } =20 -void audio_sample_from_uint64(void *samples, int pos, +void audio_sample_from_uint64(st_sample *sample, int pos, uint64_t left, uint64_t right) { #ifdef FLOAT_MIXENG @@ -427,7 +426,6 @@ void audio_sample_from_uint64(void *samples, int pos, "Coreaudio and floating point samples are not supported by replay = yet"); abort(); #else - struct st_sample *sample =3D samples; sample +=3D pos; sample->l =3D left; sample->r =3D right; diff --git a/replay/replay-audio.c b/replay/replay-audio.c index ed2ba2164b..3413801062 100644 --- a/replay/replay-audio.c +++ b/replay/replay-audio.c @@ -35,7 +35,7 @@ void replay_audio_out(size_t *played) } } =20 -void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t= size) +void replay_audio_in(size_t *recorded, st_sample *samples, size_t *wpos, s= ize_t size) { int pos; uint64_t left, right; diff --git a/replay/stubs-system.c b/replay/stubs-system.c index 8f2b2d326e..7f85764936 100644 --- a/replay/stubs-system.c +++ b/replay/stubs-system.c @@ -15,7 +15,7 @@ void replay_input_sync_event(void) void replay_add_blocker(const char *feature) { } -void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t= size) +void replay_audio_in(size_t *recorded, st_sample *samples, size_t *wpos, s= ize_t size) { } void replay_audio_out(size_t *played) --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037847; cv=none; d=zohomail.com; s=zohoarc; b=KMWHezqa5Rh+qQVj3igQZ+2aC6DnadFfGNiy79eii4EFjXnOEWFs/+FQ5v7kZSLPxPUzi0YY4EPWkuB0+QKjrOlRHCapQfCmcOSfeBS4rgDIvLF7rBzc5egSVW+5pI4di6TCnwFX1BDBfWPOkPI8bDaVr8Ac+maxYjtikwjmCPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037847; 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=5MPTE8Akx8DrDppQ1jTwOSmdu3PRNzUQfGjGiHQQmoQ=; b=QjBrKeYDY/VATAS8xwc+13zqNoLg1PNavNGHPoP0zq2MbDbVn3/OGWUsljqTRb8XBUGfwUFPsEGHNdPyXwlpFf5XOBB7H4WPUAIXFXy6aoeCFydedFC+tETklkUlpTQvXE7wo4W5/B2yhYDwcM2rU9jGQ17YOKRWsW7q7/zrVmU= 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 1761037847027165.2710631738746; Tue, 21 Oct 2025 02:10:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8K8-0005re-AJ; Tue, 21 Oct 2025 05:06:32 -0400 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 1vB8K5-0005jN-9i for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8K2-0004Jk-Ht for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:28 -0400 Received: from mx-prod-mc-03.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-102-Ub9OROPtOQ2e4ATRYFGpow-1; Tue, 21 Oct 2025 05:06:23 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9FC319560B7; Tue, 21 Oct 2025 09:06:22 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8674630001BE; Tue, 21 Oct 2025 09:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037585; 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=5MPTE8Akx8DrDppQ1jTwOSmdu3PRNzUQfGjGiHQQmoQ=; b=D1A7c+7xYgCauZ7JjFgyXoSZ0sqEeuHG9WEwGx1s3oWTaL8x34np8BtYjWkHNpIHT5P3m6 ODsfnrlP4BbgVWLbzGJU7pBATQP5z7GOo04yF6DSkhypTVkL0eLX5mjwznzlglL+x2yag1 6/t2WEd7OZd+5NFgTkb3PHb0fqQkI7s= X-MC-Unique: Ub9OROPtOQ2e4ATRYFGpow-1 X-Mimecast-MFC-AGG-ID: Ub9OROPtOQ2e4ATRYFGpow_1761037582 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 33/43] audio: move internal APIs to audio_int.h Date: Tue, 21 Oct 2025 13:03:04 +0400 Message-ID: <20251021090317.425409-34-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.4 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037856444158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 21 --------------------- audio/audio_int.h | 22 ++++++++++++++++++++++ audio/audio-hmp-cmds.c | 2 +- audio/wavcapture.c | 2 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 91e8a4f23d..1858b930ca 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -38,15 +38,6 @@ typedef struct audsettings { int endianness; } audsettings; =20 -audsettings audiodev_to_audsettings(AudiodevPerDirectionOptions *pdo); -int audioformat_bytes_per_sample(AudioFormat fmt); -int audio_buffer_frames(AudiodevPerDirectionOptions *pdo, - audsettings *as, int def_usecs); -int audio_buffer_samples(AudiodevPerDirectionOptions *pdo, - audsettings *as, int def_usecs); -int audio_buffer_bytes(AudiodevPerDirectionOptions *pdo, - audsettings *as, int def_usecs); - typedef enum { AUD_CNOTIFY_ENABLE, AUD_CNOTIFY_DISABLE @@ -89,9 +80,6 @@ typedef struct QEMUAudioTimeStamp { uint64_t old_ts; } QEMUAudioTimeStamp; =20 -void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF= (2, 0); -void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3); - bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p); void AUD_remove_card (QEMUSoundCard *card); CaptureVoiceOut *AUD_add_capture( @@ -150,15 +138,6 @@ int AUD_is_active_in (SWVoiceIn *sw); void AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); =20 -static inline void *advance (void *p, int incr) -{ - uint8_t *d =3D p; - return (d + incr); -} - -int wav_start_capture(AudioState *state, CaptureState *s, const char *path, - int freq, int bits, int nchannels); - void audio_cleanup(void); =20 typedef struct st_sample st_sample; diff --git a/audio/audio_int.h b/audio/audio_int.h index 4a4d69f2bf..cc7a6fe087 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -29,12 +29,16 @@ #define FLOAT_MIXENG /* #define RECIPROCAL */ #endif +#include "audio.h" #include "mixeng.h" =20 #ifdef CONFIG_GIO #include #endif =20 +void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF= (2, 0); +void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3); + struct audio_pcm_ops; =20 struct audio_callback { @@ -187,6 +191,24 @@ struct audio_pcm_ops { void (*volume_in)(HWVoiceIn *hw, Volume *vol); }; =20 +audsettings audiodev_to_audsettings(AudiodevPerDirectionOptions *pdo); +int audioformat_bytes_per_sample(AudioFormat fmt); +int audio_buffer_frames(AudiodevPerDirectionOptions *pdo, + audsettings *as, int def_usecs); +int audio_buffer_samples(AudiodevPerDirectionOptions *pdo, + audsettings *as, int def_usecs); +int audio_buffer_bytes(AudiodevPerDirectionOptions *pdo, + audsettings *as, int def_usecs); + +static inline void *advance (void *p, int incr) +{ + uint8_t *d =3D p; + return (d + incr); +} + +int wav_start_capture(AudioState *state, CaptureState *s, const char *path, + int freq, int bits, int nchannels); + void audio_generic_run_buffer_in(HWVoiceIn *hw); void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size); void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size); diff --git a/audio/audio-hmp-cmds.c b/audio/audio-hmp-cmds.c index 8774c09f18..819f8fa9d8 100644 --- a/audio/audio-hmp-cmds.c +++ b/audio/audio-hmp-cmds.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "audio/audio.h" +#include "audio_int.h" #include "monitor/hmp.h" #include "monitor/monitor.h" #include "qapi/error.h" diff --git a/audio/wavcapture.c b/audio/wavcapture.c index b990844d48..0fbc695d23 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" #include "qemu/qemu-print.h" #include "qemu/error-report.h" -#include "audio.h" +#include "audio_int.h" =20 typedef struct { FILE *f; --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037900; cv=none; d=zohomail.com; s=zohoarc; b=KR9GChyK1E4tTC+WzJFVKFDKOLa3+wbdYmwR+l3W4W8LcJGX+33ieRSQ2rgBBx7UViamSMgsl5yaUNISCMUF+SZLt1bY7EEKh9FnLP4L01yodc7CnJb2fA+mxfwYiRKjfaQqZPug1TvAiQ8WFKPO92RVMww3Hr9w3MgDuGD/J/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037900; 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=QbMoVBiGjl+/cPcKZiPiFx9lUZZmCtLusIfAPN9exic=; b=KACC1GqLw/uRvcI0L60pJGx1CbkxY4/6mR2MKlu/eaZu1XeF5qhIZ0rFkipkGOA/JVV2w4UWlT9EJapO3jorj4EESCkCBZbyWW40phDnodDxg1CxM7jcw6sWl8gQqk/9/PuPq1g10tUk0wk3p5FOhS4fgY0V0T6B5TkY7/wlE2k= 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 1761037900805451.380631889372; Tue, 21 Oct 2025 02:11:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8KO-0006fy-UJ; Tue, 21 Oct 2025 05:06:49 -0400 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 1vB8KN-0006cF-Da for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8KE-0004M0-6f for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:47 -0400 Received: from mx-prod-mc-03.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-90-1ThI3nwCNWGfA2X5GkV7Hw-1; Tue, 21 Oct 2025 05:06:31 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20CA61956072; Tue, 21 Oct 2025 09:06:29 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D06591955F22; Tue, 21 Oct 2025 09:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037594; 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=QbMoVBiGjl+/cPcKZiPiFx9lUZZmCtLusIfAPN9exic=; b=JgrWn0n/tkcEdPPpIfIf6WFqRlEJwFP4iFiU2e/oru3N8MBNLkw7XdD6R/13surl/oKWfO SCvohXFrwesPJ5hycGmRqkXUR/j1IPvZxWZ9P8DC8INvX2shrfJnjhtD7aZSujzRcYecpi a2iACY7kRkvJOIqTf+IC6dq7rZhMHnc= X-MC-Unique: 1ThI3nwCNWGfA2X5GkV7Hw-1 X-Mimecast-MFC-AGG-ID: 1ThI3nwCNWGfA2X5GkV7Hw_1761037589 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Christian Schoenebeck , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 34/43] audio: rename AudioState -> AudioBE Date: Tue, 21 Oct 2025 13:03:05 +0400 Message-ID: <20251021090317.425409-35-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037905079158500 From: Marc-Andr=C3=A9 Lureau Naming is hard. But in general in QEMU, a host "backend" is the term used to fullfill the request made by the device "frontend". Note that "audiodev" is the corresponding QAPI type name (or configuration). Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 18 +++---- audio/audio_int.h | 20 +++---- audio/audio_template.h | 20 +++---- ui/vnc.h | 2 +- audio/alsaaudio.c | 2 +- audio/audio-hmp-cmds.c | 2 +- audio/audio.c | 90 ++++++++++++++++---------------- audio/dbusaudio.c | 8 +-- audio/ossaudio.c | 4 +- audio/wavcapture.c | 2 +- hw/audio/pcspk.c | 2 +- hw/core/machine.c | 2 +- hw/core/qdev-properties-system.c | 6 +-- ui/dbus.c | 8 +-- ui/vnc.c | 10 ++-- 15 files changed, 98 insertions(+), 98 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 1858b930ca..845e078169 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -64,15 +64,15 @@ typedef struct SWVoiceOut SWVoiceOut; typedef struct CaptureVoiceOut CaptureVoiceOut; typedef struct SWVoiceIn SWVoiceIn; =20 -typedef struct AudioStateClass AudioStateClass; -struct AudioStateClass { +typedef struct AudioBEClass AudioBEClass; +struct AudioBEClass { ObjectClass parent_class; }; =20 -typedef struct AudioState AudioState; +typedef struct AudioBE AudioBE; typedef struct QEMUSoundCard { char *name; - AudioState *state; + AudioBE *be; QLIST_ENTRY (QEMUSoundCard) entries; } QEMUSoundCard; =20 @@ -83,7 +83,7 @@ typedef struct QEMUAudioTimeStamp { bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p); void AUD_remove_card (QEMUSoundCard *card); CaptureVoiceOut *AUD_add_capture( - AudioState *s, + AudioBE *s, struct audsettings *as, struct audio_capture_ops *ops, void *opaque @@ -154,14 +154,14 @@ void audio_create_default_audiodevs(void); void audio_init_audiodevs(void); void audio_help(void); =20 -AudioState *audio_state_by_name(const char *name, Error **errp); -AudioState *audio_get_default_audio_state(Error **errp); +AudioBE *audio_be_by_name(const char *name, Error **errp); +AudioBE *audio_get_default_audio_be(Error **errp); const char *audio_get_id(QEMUSoundCard *card); =20 #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) =20 -#define TYPE_AUDIO_STATE "audio-state" -OBJECT_DECLARE_TYPE(AudioState, AudioStateClass, AUDIO_STATE) +#define TYPE_AUDIO_BE "audio-be" +OBJECT_DECLARE_TYPE(AudioBE, AudioBEClass, AUDIO_BE) =20 #endif /* QEMU_AUDIO_H */ diff --git a/audio/audio_int.h b/audio/audio_int.h index cc7a6fe087..d7e24ec089 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -57,7 +57,7 @@ struct audio_pcm_info { int swap_endianness; }; =20 -typedef struct AudioState AudioState; +typedef struct AudioBE AudioBE; typedef struct SWVoiceCap SWVoiceCap; =20 typedef struct STSampleBuffer { @@ -66,7 +66,7 @@ typedef struct STSampleBuffer { } STSampleBuffer; =20 typedef struct HWVoiceOut { - AudioState *s; + AudioBE *s; int enabled; int poll_mode; int pending_disable; @@ -87,7 +87,7 @@ typedef struct HWVoiceOut { } HWVoiceOut; =20 typedef struct HWVoiceIn { - AudioState *s; + AudioBE *s; int enabled; int poll_mode; struct audio_pcm_info info; @@ -109,7 +109,7 @@ typedef struct HWVoiceIn { =20 struct SWVoiceOut { QEMUSoundCard *card; - AudioState *s; + AudioBE *s; struct audio_pcm_info info; t_sample *conv; STSampleBuffer resample_buf; @@ -126,7 +126,7 @@ struct SWVoiceOut { =20 struct SWVoiceIn { QEMUSoundCard *card; - AudioState *s; + AudioBE *s; int active; struct audio_pcm_info info; void *rate; @@ -147,7 +147,7 @@ struct audio_driver { void *(*init) (Audiodev *, Error **); void (*fini) (void *); #ifdef CONFIG_GIO - void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger, bool p2p); + void (*set_dbus_server) (AudioBE *s, GDBusObjectManagerServer *manager= , bool p2p); #endif struct audio_pcm_ops *pcm_ops; int max_voices_out; @@ -206,7 +206,7 @@ static inline void *advance (void *p, int incr) return (d + incr); } =20 -int wav_start_capture(AudioState *state, CaptureState *s, const char *path, +int wav_start_capture(AudioBE *state, CaptureState *s, const char *path, int freq, int bits, int nchannels); =20 void audio_generic_run_buffer_in(HWVoiceIn *hw); @@ -238,7 +238,7 @@ struct SWVoiceCap { QLIST_ENTRY (SWVoiceCap) entries; }; =20 -typedef struct AudioState { +typedef struct AudioBE { Object parent; =20 struct audio_driver *drv; @@ -258,7 +258,7 @@ typedef struct AudioState { bool timer_running; uint64_t timer_last; VMChangeStateEntry *vmse; -} AudioState; +} AudioBE; =20 extern const struct mixeng_volume nominal_volume; =20 @@ -271,7 +271,7 @@ void audio_pcm_info_clear_buf (struct audio_pcm_info *i= nfo, void *buf, int len); =20 int audio_bug (const char *funcname, int cond); =20 -void audio_run(AudioState *s, const char *msg); +void audio_run(AudioBE *s, const char *msg); =20 const char *audio_application_name(void); =20 diff --git a/audio/audio_template.h b/audio/audio_template.h index c29d79c443..c8f3e9dc93 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -36,7 +36,7 @@ #define HWBUF hw->conv_buf #endif =20 -static void glue(audio_init_nb_voices_, TYPE)(AudioState *s, +static void glue(audio_init_nb_voices_, TYPE)(AudioBE *s, struct audio_driver *drv, in= t min_voices) { int max_voices =3D glue (drv->max_voices_, TYPE); @@ -221,7 +221,7 @@ static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw) static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp) { HW *hw =3D *hwp; - AudioState *s =3D hw->s; + AudioBE *s =3D hw->s; =20 if (!hw->sw_head.lh_first) { #ifdef DAC @@ -236,12 +236,12 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp) } } =20 -static HW *glue(audio_pcm_hw_find_any_, TYPE)(AudioState *s, HW *hw) +static HW *glue(audio_pcm_hw_find_any_, TYPE)(AudioBE *s, HW *hw) { return hw ? hw->entries.le_next : glue (s->hw_head_, TYPE).lh_first; } =20 -static HW *glue(audio_pcm_hw_find_any_enabled_, TYPE)(AudioState *s, HW *h= w) +static HW *glue(audio_pcm_hw_find_any_enabled_, TYPE)(AudioBE *s, HW *hw) { while ((hw =3D glue(audio_pcm_hw_find_any_, TYPE)(s, hw))) { if (hw->enabled) { @@ -251,7 +251,7 @@ static HW *glue(audio_pcm_hw_find_any_enabled_, TYPE)(A= udioState *s, HW *hw) return NULL; } =20 -static HW *glue(audio_pcm_hw_find_specific_, TYPE)(AudioState *s, HW *hw, +static HW *glue(audio_pcm_hw_find_specific_, TYPE)(AudioBE *s, HW *hw, struct audsettings *as) { while ((hw =3D glue(audio_pcm_hw_find_any_, TYPE)(s, hw))) { @@ -262,7 +262,7 @@ static HW *glue(audio_pcm_hw_find_specific_, TYPE)(Audi= oState *s, HW *hw, return NULL; } =20 -static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s, +static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioBE *s, struct audsettings *as) { HW *hw; @@ -398,7 +398,7 @@ AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)= (Audiodev *dev) abort(); } =20 -static HW *glue(audio_pcm_hw_add_, TYPE)(AudioState *s, struct audsettings= *as) +static HW *glue(audio_pcm_hw_add_, TYPE)(AudioBE *s, struct audsettings *a= s) { HW *hw; AudiodevPerDirectionOptions *pdo =3D glue(audio_get_pdo_, TYPE)(s->dev= ); @@ -424,7 +424,7 @@ static HW *glue(audio_pcm_hw_add_, TYPE)(AudioState *s,= struct audsettings *as) } =20 static SW *glue(audio_pcm_create_voice_pair_, TYPE)( - AudioState *s, + AudioBE *s, const char *sw_name, struct audsettings *as ) @@ -494,7 +494,7 @@ SW *glue (AUD_open_, TYPE) ( struct audsettings *as ) { - AudioState *s; + AudioBE *s; AudiodevPerDirectionOptions *pdo; =20 if (audio_bug(__func__, !card || !name || !callback_fn || !as)) { @@ -503,7 +503,7 @@ SW *glue (AUD_open_, TYPE) ( goto fail; } =20 - s =3D card->state; + s =3D card->be; pdo =3D glue(audio_get_pdo_, TYPE)(s->dev); =20 ldebug ("open %s, freq %d, nchannels %d, fmt %d\n", diff --git a/ui/vnc.h b/ui/vnc.h index f2dab2f4d9..a6aac50ec3 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -184,7 +184,7 @@ struct VncDisplay VncDisplaySASL sasl; #endif =20 - AudioState *audio_state; + AudioBE *audio_be; =20 VMChangeStateEntry *vmstate_handler_entry; }; diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 9b6c01c0ef..1c762e0e24 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -41,7 +41,7 @@ struct pollhlp { struct pollfd *pfds; int count; int mask; - AudioState *s; + AudioBE *s; }; =20 typedef struct ALSAVoiceOut { diff --git a/audio/audio-hmp-cmds.c b/audio/audio-hmp-cmds.c index 819f8fa9d8..f7a7d0c947 100644 --- a/audio/audio-hmp-cmds.c +++ b/audio/audio-hmp-cmds.c @@ -67,7 +67,7 @@ void hmp_wavcapture(Monitor *mon, const QDict *qdict) const char *audiodev =3D qdict_get_str(qdict, "audiodev"); CaptureState *s; Error *local_err =3D NULL; - AudioState *as =3D audio_state_by_name(audiodev, &local_err); + AudioBE *as =3D audio_be_by_name(audiodev, &local_err); =20 if (!as) { error_report_err(local_err); diff --git a/audio/audio.c b/audio/audio.c index 9e6d79b4e3..66a2e86f13 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -99,7 +99,7 @@ static audio_driver *audio_driver_lookup(const char *name) return NULL; } =20 -static AudioState *default_audio_state; +static AudioBE *default_audio_be; =20 const struct mixeng_volume nominal_volume =3D { .mute =3D 0, @@ -380,7 +380,7 @@ void audio_pcm_info_clear_buf (struct audio_pcm_info *i= nfo, void *buf, int len) /* * Capture */ -static CaptureVoiceOut *audio_pcm_capture_find_specific(AudioState *s, +static CaptureVoiceOut *audio_pcm_capture_find_specific(AudioBE *s, struct audsettings= *as) { CaptureVoiceOut *cap; @@ -460,7 +460,7 @@ static void audio_detach_capture (HWVoiceOut *hw) =20 static int audio_attach_capture (HWVoiceOut *hw) { - AudioState *s =3D hw->s; + AudioBE *s =3D hw->s; CaptureVoiceOut *cap; =20 audio_detach_capture (hw); @@ -798,7 +798,7 @@ static void audio_pcm_print_info (const char *cap, stru= ct audio_pcm_info *info) /* * Timer */ -static int audio_is_timer_needed(AudioState *s) +static int audio_is_timer_needed(AudioBE *s) { HWVoiceIn *hwi =3D NULL; HWVoiceOut *hwo =3D NULL; @@ -816,7 +816,7 @@ static int audio_is_timer_needed(AudioState *s) return 0; } =20 -static void audio_reset_timer (AudioState *s) +static void audio_reset_timer (AudioBE *s) { if (audio_is_timer_needed(s)) { timer_mod_anticipate_ns(s->ts, @@ -838,7 +838,7 @@ static void audio_reset_timer (AudioState *s) static void audio_timer (void *opaque) { int64_t now, diff; - AudioState *s =3D opaque; + AudioBE *s =3D opaque; =20 now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); diff =3D now - s->timer_last; @@ -921,7 +921,7 @@ void AUD_set_active_out (SWVoiceOut *sw, int on) =20 hw =3D sw->hw; if (sw->active !=3D on) { - AudioState *s =3D sw->s; + AudioBE *s =3D sw->s; SWVoiceOut *temp_sw; SWVoiceCap *sc; =20 @@ -969,7 +969,7 @@ void AUD_set_active_in (SWVoiceIn *sw, int on) =20 hw =3D sw->hw; if (sw->active !=3D on) { - AudioState *s =3D sw->s; + AudioBE *s =3D sw->s; SWVoiceIn *temp_sw; =20 if (on) { @@ -1137,7 +1137,7 @@ static size_t audio_pcm_hw_run_out(HWVoiceOut *hw, si= ze_t live) return clipped; } =20 -static void audio_run_out (AudioState *s) +static void audio_run_out (AudioBE *s) { HWVoiceOut *hw =3D NULL; SWVoiceOut *sw; @@ -1291,7 +1291,7 @@ static size_t audio_pcm_hw_run_in(HWVoiceIn *hw, size= _t samples) return conv; } =20 -static void audio_run_in (AudioState *s) +static void audio_run_in (AudioBE *s) { HWVoiceIn *hw =3D NULL; =20 @@ -1339,7 +1339,7 @@ static void audio_run_in (AudioState *s) } } =20 -static void audio_run_capture (AudioState *s) +static void audio_run_capture (AudioBE *s) { CaptureVoiceOut *cap; =20 @@ -1386,7 +1386,7 @@ static void audio_run_capture (AudioState *s) } } =20 -void audio_run(AudioState *s, const char *msg) +void audio_run(AudioBE *s, const char *msg) { audio_run_out(s); audio_run_in(s); @@ -1559,7 +1559,7 @@ size_t audio_generic_read(HWVoiceIn *hw, void *buf, s= ize_t size) return total; } =20 -static bool audio_driver_init(AudioState *s, struct audio_driver *drv, +static bool audio_driver_init(AudioBE *s, struct audio_driver *drv, Audiodev *dev, Error **errp) { s->drv_opaque =3D drv->init(dev, errp); @@ -1592,7 +1592,7 @@ static bool audio_driver_init(AudioState *s, struct a= udio_driver *drv, static void audio_vm_change_state_handler (void *opaque, bool running, RunState state) { - AudioState *s =3D opaque; + AudioBE *s =3D opaque; HWVoiceOut *hwo =3D NULL; HWVoiceIn *hwi =3D NULL; =20 @@ -1613,9 +1613,9 @@ static void audio_vm_change_state_handler (void *opaq= ue, bool running, =20 static const VMStateDescription vmstate_audio; =20 -static void audio_state_init(Object *obj) +static void audio_be_init(Object *obj) { - AudioState *s =3D AUDIO_STATE(obj); + AudioBE *s =3D AUDIO_BE(obj); =20 QLIST_INIT (&s->hw_head_out); QLIST_INIT (&s->hw_head_in); @@ -1629,9 +1629,9 @@ static void audio_state_init(Object *obj) vmstate_register_any(NULL, &vmstate_audio, s); } =20 -static void audio_state_finalize(Object *obj) +static void audio_be_finalize(Object *obj) { - AudioState *s =3D AUDIO_STATE(obj); + AudioBE *s =3D AUDIO_BE(obj); HWVoiceOut *hwo, *hwon; HWVoiceIn *hwi, *hwin; =20 @@ -1692,7 +1692,7 @@ static Object *get_audiodevs_root(void) =20 void audio_cleanup(void) { - default_audio_state =3D NULL; + default_audio_be =3D NULL; =20 object_unparent(get_audiodevs_root()); } @@ -1743,14 +1743,14 @@ void audio_create_default_audiodevs(void) * if dev =3D=3D NULL =3D> legacy implicit initialization, return the alre= ady created * state or create a new one */ -static AudioState *audio_init(Audiodev *dev, Error **errp) +static AudioBE *audio_init(Audiodev *dev, Error **errp) { int done =3D 0; const char *drvname; - AudioState *s; + AudioBE *s; struct audio_driver *driver; =20 - s =3D AUDIO_STATE(object_new(TYPE_AUDIO_STATE)); + s =3D AUDIO_BE(object_new(TYPE_AUDIO_BE)); =20 if (dev) { /* -audiodev option */ @@ -1766,7 +1766,7 @@ static AudioState *audio_init(Audiodev *dev, Error **= errp) goto out; } } else { - assert(!default_audio_state); + assert(!default_audio_be); for (;;) { AudiodevListEntry *e =3D QSIMPLEQ_FIRST(&default_audiodevs); if (!e) { @@ -1797,11 +1797,11 @@ out: return NULL; } =20 -AudioState *audio_get_default_audio_state(Error **errp) +AudioBE *audio_get_default_audio_be(Error **errp) { - if (!default_audio_state) { - default_audio_state =3D audio_init(NULL, errp); - if (!default_audio_state) { + if (!default_audio_be) { + default_audio_be =3D audio_init(NULL, errp); + if (!default_audio_be) { if (!QSIMPLEQ_EMPTY(&audiodevs)) { error_append_hint(errp, "Perhaps you wanted to use -audio = or set audiodev=3D%s?\n", QSIMPLEQ_FIRST(&audiodevs)->dev->id); @@ -1809,21 +1809,21 @@ AudioState *audio_get_default_audio_state(Error **e= rrp) } } =20 - return default_audio_state; + return default_audio_be; } =20 bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p) { - if (!card->state) { - card->state =3D audio_get_default_audio_state(errp); - if (!card->state) { + if (!card->be) { + card->be =3D audio_get_default_audio_be(errp); + if (!card->be) { return false; } } =20 card->name =3D g_strdup (name); memset (&card->entries, 0, sizeof (card->entries)); - QLIST_INSERT_HEAD(&card->state->card_head, card, entries); + QLIST_INSERT_HEAD(&card->be->card_head, card, entries); =20 return true; } @@ -1837,7 +1837,7 @@ void AUD_remove_card (QEMUSoundCard *card) static struct audio_pcm_ops capture_pcm_ops; =20 CaptureVoiceOut *AUD_add_capture( - AudioState *s, + AudioBE *s, struct audsettings *as, struct audio_capture_ops *ops, void *cb_opaque @@ -2220,7 +2220,7 @@ int audio_buffer_bytes(AudiodevPerDirectionOptions *p= do, audioformat_bytes_per_sample(as->fmt); } =20 -AudioState *audio_state_by_name(const char *name, Error **errp) +AudioBE *audio_be_by_name(const char *name, Error **errp) { Object *obj =3D object_resolve_path_component(get_audiodevs_root(), na= me); =20 @@ -2228,15 +2228,15 @@ AudioState *audio_state_by_name(const char *name, E= rror **errp) error_setg(errp, "audiodev '%s' not found", name); return NULL; } else { - return AUDIO_STATE(obj); + return AUDIO_BE(obj); } } =20 const char *audio_get_id(QEMUSoundCard *card) { - if (card->state) { - assert(card->state->dev); - return card->state->dev->id; + if (card->be) { + assert(card->be->dev); + return card->be->dev->id; } else { return ""; } @@ -2305,19 +2305,19 @@ AudiodevList *qmp_query_audiodevs(Error **errp) return ret; } =20 -static const TypeInfo audio_state_info =3D { - .name =3D TYPE_AUDIO_STATE, +static const TypeInfo audio_be_info =3D { + .name =3D TYPE_AUDIO_BE, .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(AudioState), - .instance_init =3D audio_state_init, - .instance_finalize =3D audio_state_finalize, + .instance_size =3D sizeof(AudioBE), + .instance_init =3D audio_be_init, + .instance_finalize =3D audio_be_finalize, .abstract =3D false, // todo, subclass and make it abstract - .class_size =3D sizeof(AudioStateClass), + .class_size =3D sizeof(AudioBEClass), }; =20 static void register_types(void) { - type_register_static(&audio_state_info); + type_register_static(&audio_be_info); } =20 type_init(register_types); diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 908214a170..873f76a89e 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -458,7 +458,7 @@ listener_in_vanished_cb(GDBusConnection *connection, } =20 static gboolean -dbus_audio_register_listener(AudioState *s, +dbus_audio_register_listener(AudioBE *s, GDBusMethodInvocation *invocation, #ifdef G_OS_UNIX GUnixFDList *fd_list, @@ -615,7 +615,7 @@ dbus_audio_register_listener(AudioState *s, } =20 static gboolean -dbus_audio_register_out_listener(AudioState *s, +dbus_audio_register_out_listener(AudioBE *s, GDBusMethodInvocation *invocation, #ifdef G_OS_UNIX GUnixFDList *fd_list, @@ -631,7 +631,7 @@ dbus_audio_register_out_listener(AudioState *s, } =20 static gboolean -dbus_audio_register_in_listener(AudioState *s, +dbus_audio_register_in_listener(AudioBE *s, GDBusMethodInvocation *invocation, #ifdef G_OS_UNIX GUnixFDList *fd_list, @@ -646,7 +646,7 @@ dbus_audio_register_in_listener(AudioState *s, } =20 static void -dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, boo= l p2p) +dbus_audio_set_server(AudioBE *s, GDBusObjectManagerServer *server, bool p= 2p) { DBusAudio *da =3D s->drv_opaque; =20 diff --git a/audio/ossaudio.c b/audio/ossaudio.c index c5858284a1..f202e743ff 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -107,13 +107,13 @@ static void oss_anal_close (int *fdp) =20 static void oss_helper_poll_out (void *opaque) { - AudioState *s =3D opaque; + AudioBE *s =3D opaque; audio_run(s, "oss_poll_out"); } =20 static void oss_helper_poll_in (void *opaque) { - AudioState *s =3D opaque; + AudioBE *s =3D opaque; audio_run(s, "oss_poll_in"); } =20 diff --git a/audio/wavcapture.c b/audio/wavcapture.c index 0fbc695d23..55ba0906a2 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -103,7 +103,7 @@ static struct capture_ops wav_capture_ops =3D { .info =3D wav_capture_info }; =20 -int wav_start_capture(AudioState *state, CaptureState *s, const char *path, +int wav_start_capture(AudioBE *state, CaptureState *s, const char *path, int freq, int bits, int nchannels) { WAVState *wav; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index c8c63b7915..e9ab5ac41b 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -188,7 +188,7 @@ static void pcspk_realizefn(DeviceState *dev, Error **e= rrp) =20 isa_register_ioport(isadev, &s->ioport, s->iobase); =20 - if (s->card.state && AUD_register_card(s_spk, &s->card, errp)) { + if (s->card.be && AUD_register_card(s_spk, &s->card, errp)) { pcspk_audio_init(s); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index 681adbb7ac..2de8b89606 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -763,7 +763,7 @@ static void machine_set_audiodev(Object *obj, const cha= r *value, { MachineState *ms =3D MACHINE(obj); =20 - if (!audio_state_by_name(value, errp)) { + if (!audio_be_by_name(value, errp)) { return; } =20 diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 1f810b7ddf..be682895f7 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -499,16 +499,16 @@ static void set_audiodev(Object *obj, Visitor *v, con= st char* name, { const Property *prop =3D opaque; QEMUSoundCard *card =3D object_field_prop_ptr(obj, prop); - AudioState *state; + AudioBE *state; g_autofree char *str =3D NULL; =20 if (!visit_type_str(v, name, &str, errp)) { return; } =20 - state =3D audio_state_by_name(str, errp); + state =3D audio_be_by_name(str, errp); if (state) { - card->state =3D state; + card->be =3D state; } } =20 diff --git a/ui/dbus.c b/ui/dbus.c index dd0336702d..962b4a8c1e 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -220,16 +220,16 @@ dbus_display_complete(UserCreatable *uc, Error **errp) } =20 if (dd->audiodev && *dd->audiodev) { - AudioState *audio_state =3D audio_state_by_name(dd->audiodev, errp= ); - if (!audio_state) { + AudioBE *audio_be =3D audio_be_by_name(dd->audiodev, errp); + if (!audio_be) { return; } - if (!g_str_equal(audio_state->drv->name, "dbus")) { + if (!g_str_equal(audio_be->drv->name, "dbus")) { error_setg(errp, "Audiodev '%s' is not compatible with DBus", dd->audiodev); return; } - audio_state->drv->set_dbus_server(audio_state, dd->server, dd->p2p= ); + audio_be->drv->set_dbus_server(audio_be, dd->server, dd->p2p); } =20 consoles =3D g_array_new(FALSE, FALSE, sizeof(guint32)); diff --git a/ui/vnc.c b/ui/vnc.c index 77c823bf2e..0094ec680c 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1276,7 +1276,7 @@ static void audio_add(VncState *vs) ops.destroy =3D audio_capture_destroy; ops.capture =3D audio_capture; =20 - vs->audio_cap =3D AUD_add_capture(vs->vd->audio_state, &vs->as, &ops, = vs); + vs->audio_cap =3D AUD_add_capture(vs->vd->audio_be, &vs->as, &ops, vs); if (!vs->audio_cap) { error_report("Failed to add audio capture"); } @@ -2193,7 +2193,7 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) send_ext_key_event_ack(vs); break; case VNC_ENCODING_AUDIO: - if (vs->vd->audio_state) { + if (vs->vd->audio_be) { vnc_set_feature(vs, VNC_FEATURE_AUDIO); send_ext_audio_ack(vs); } @@ -4236,12 +4236,12 @@ void vnc_display_open(const char *id, Error **errp) =20 audiodev =3D qemu_opt_get(opts, "audiodev"); if (audiodev) { - vd->audio_state =3D audio_state_by_name(audiodev, errp); - if (!vd->audio_state) { + vd->audio_be =3D audio_be_by_name(audiodev, errp); + if (!vd->audio_be) { goto fail; } } else { - vd->audio_state =3D audio_get_default_audio_state(NULL); + vd->audio_be =3D audio_get_default_audio_be(NULL); } =20 device_id =3D qemu_opt_get(opts, "display"); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037750; cv=none; d=zohomail.com; s=zohoarc; b=URLuXoZJogzAHt5aFhTzz3rKMTpPJ01eCi4qwYeD3zDWsVYmZtUyM77X0NQkoVx24VVQJjQcugCXKkw+96iDTiMQkRDlLZNC6cvNRl840j6hHVtgKT8GWoXwZYersrq8fZBUg1LM5n0e3e4l6IkEOzX2911eyH63k3g3rNkPJjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037750; 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=a56qxv3Kx2W2U/RuFPR1YFbZxI0H20NUSNDtwfSkHwI=; b=SOxdPICrrG/V1du6pY/AuF7WneEHL2+jg+V96xdZjT8V/RgLCRRt6e3sIYJM67L8CXSXOa46O6ecV8XR+yf+NDP0hDTA/0NtxMkYLjTBofPlzt8rV4I6sNiweZvfv6FvV/n2tEZE+kQG6CGkDmWYQ6EC0Tt3nwqDFu8MY6zePMQ= 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 176103775065432.81050267638682; Tue, 21 Oct 2025 02:09:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Kj-0006ol-F2; Tue, 21 Oct 2025 05:07:11 -0400 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 1vB8KR-0006kT-52 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:51 -0400 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 1vB8KL-0004O8-QN for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:50 -0400 Received: from mx-prod-mc-04.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-145--ZXsa_PhOdKqV8f_74DUeg-1; Tue, 21 Oct 2025 05:06:38 -0400 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C079195420F; Tue, 21 Oct 2025 09:06:36 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ECFAF180057C; Tue, 21 Oct 2025 09:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037604; 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=a56qxv3Kx2W2U/RuFPR1YFbZxI0H20NUSNDtwfSkHwI=; b=TBQTtLHn7iYbcQ8PvDbmCnLN7fvzCzUzOeX2qsCVWNPoOTOBy9Kr+6vD50i1QPntXbESD6 Ihj0cp4IG51bi5SyH74tFeJqZTXwqdWD0IdB8IlpN2RDBp7dn9HmURqeboYtdRt9GhK/Le 0OvO0jWuuzBynX8KtiBwZ+HCSUeghKc= X-MC-Unique: -ZXsa_PhOdKqV8f_74DUeg-1 X-Mimecast-MFC-AGG-ID: -ZXsa_PhOdKqV8f_74DUeg_1761037596 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Laurent Vivier , Manos Pitsidianakis , "Michael S. Tsirkin" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Alistair Francis , "Edgar E. Iglesias" , Peter Maydell , Jiaxun Yang , qemu-arm@nongnu.org (open list:Xilinx ZynqMP and...) Subject: [PATCH 35/43] audio: rename QEMUSoundCard -> AudioFE Date: Tue, 21 Oct 2025 13:03:06 +0400 Message-ID: <20251021090317.425409-36-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037753517154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 20 ++++++++++---------- audio/audio_int.h | 6 +++--- audio/audio_template.h | 4 ++-- hw/audio/lm4549.h | 2 +- include/hw/audio/asc.h | 2 +- include/hw/audio/virtio-snd.h | 2 +- include/hw/display/xlnx_dp.h | 2 +- include/hw/isa/vt82c686.h | 2 +- include/hw/qdev-properties-system.h | 2 +- audio/audio.c | 10 +++++----- hw/audio/ac97.c | 6 +++--- hw/audio/adlib.c | 6 +++--- hw/audio/asc.c | 6 +++--- hw/audio/cs4231a.c | 4 ++-- hw/audio/es1370.c | 6 +++--- hw/audio/gus.c | 6 +++--- hw/audio/hda-codec.c | 6 +++--- hw/audio/lm4549.c | 2 +- hw/audio/pcspk.c | 4 ++-- hw/audio/sb16.c | 4 ++-- hw/audio/via-ac97.c | 4 ++-- hw/audio/virtio-snd.c | 4 ++-- hw/audio/wm8750.c | 6 +++--- hw/core/qdev-properties-system.c | 4 ++-- hw/display/xlnx_dp.c | 2 +- hw/usb/dev-audio.c | 6 +++--- 26 files changed, 64 insertions(+), 64 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 845e078169..a43ca0700c 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -70,18 +70,18 @@ struct AudioBEClass { }; =20 typedef struct AudioBE AudioBE; -typedef struct QEMUSoundCard { +typedef struct AudioFE { char *name; AudioBE *be; - QLIST_ENTRY (QEMUSoundCard) entries; -} QEMUSoundCard; + QLIST_ENTRY (AudioFE) entries; +} AudioFE; =20 typedef struct QEMUAudioTimeStamp { uint64_t old_ts; } QEMUAudioTimeStamp; =20 -bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p); -void AUD_remove_card (QEMUSoundCard *card); +bool AUD_register_fe (const char *name, AudioFE *fe, Error **errp); +void AUD_unregister_fe (AudioFE *fe); CaptureVoiceOut *AUD_add_capture( AudioBE *s, struct audsettings *as, @@ -91,7 +91,7 @@ CaptureVoiceOut *AUD_add_capture( void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque); =20 SWVoiceOut *AUD_open_out ( - QEMUSoundCard *card, + AudioFE *fe, SWVoiceOut *sw, const char *name, void *callback_opaque, @@ -99,7 +99,7 @@ SWVoiceOut *AUD_open_out ( struct audsettings *settings ); =20 -void AUD_close_out (QEMUSoundCard *card, SWVoiceOut *sw); +void AUD_close_out (AudioFE *fe, SWVoiceOut *sw); size_t AUD_write (SWVoiceOut *sw, void *pcm_buf, size_t size); int AUD_get_buffer_size_out (SWVoiceOut *sw); void AUD_set_active_out (SWVoiceOut *sw, int on); @@ -122,7 +122,7 @@ void AUD_set_volume_out(SWVoiceOut *sw, Volume *vol); void AUD_set_volume_in(SWVoiceIn *sw, Volume *vol); =20 SWVoiceIn *AUD_open_in ( - QEMUSoundCard *card, + AudioFE *fe, SWVoiceIn *sw, const char *name, void *callback_opaque, @@ -130,7 +130,7 @@ SWVoiceIn *AUD_open_in ( struct audsettings *settings ); =20 -void AUD_close_in (QEMUSoundCard *card, SWVoiceIn *sw); +void AUD_close_in (AudioFE *fe, SWVoiceIn *sw); size_t AUD_read (SWVoiceIn *sw, void *pcm_buf, size_t size); void AUD_set_active_in (SWVoiceIn *sw, int on); int AUD_is_active_in (SWVoiceIn *sw); @@ -156,7 +156,7 @@ void audio_help(void); =20 AudioBE *audio_be_by_name(const char *name, Error **errp); AudioBE *audio_get_default_audio_be(Error **errp); -const char *audio_get_id(QEMUSoundCard *card); +const char *audio_get_id(AudioFE *fe); =20 #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) diff --git a/audio/audio_int.h b/audio/audio_int.h index d7e24ec089..5943dc3b2a 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -108,7 +108,7 @@ typedef struct HWVoiceIn { } HWVoiceIn; =20 struct SWVoiceOut { - QEMUSoundCard *card; + AudioFE *card; AudioBE *s; struct audio_pcm_info info; t_sample *conv; @@ -125,7 +125,7 @@ struct SWVoiceOut { }; =20 struct SWVoiceIn { - QEMUSoundCard *card; + AudioFE *card; AudioBE *s; int active; struct audio_pcm_info info; @@ -246,7 +246,7 @@ typedef struct AudioBE { void *drv_opaque; =20 QEMUTimer *ts; - QLIST_HEAD (card_listhead, QEMUSoundCard) card_head; + QLIST_HEAD (fe_listhead, AudioFE) fe_head; QLIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in; QLIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out; QLIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head; diff --git a/audio/audio_template.h b/audio/audio_template.h index c8f3e9dc93..e52587e02c 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -473,7 +473,7 @@ static void glue (audio_close_, TYPE) (SW *sw) g_free (sw); } =20 -void glue (AUD_close_, TYPE) (QEMUSoundCard *card, SW *sw) +void glue (AUD_close_, TYPE) (AudioFE *card, SW *sw) { if (sw) { if (audio_bug(__func__, !card)) { @@ -486,7 +486,7 @@ void glue (AUD_close_, TYPE) (QEMUSoundCard *card, SW *= sw) } =20 SW *glue (AUD_open_, TYPE) ( - QEMUSoundCard *card, + AudioFE *card, SW *sw, const char *name, void *callback_opaque , diff --git a/hw/audio/lm4549.h b/hw/audio/lm4549.h index 61c3ab12dd..45023b6535 100644 --- a/hw/audio/lm4549.h +++ b/hw/audio/lm4549.h @@ -21,7 +21,7 @@ typedef void (*lm4549_callback)(void *opaque); =20 =20 typedef struct { - QEMUSoundCard card; + AudioFE card; SWVoiceOut *voice; uint32_t voice_is_active; =20 diff --git a/include/hw/audio/asc.h b/include/hw/audio/asc.h index 04fac270b6..5c8c4ef4ec 100644 --- a/include/hw/audio/asc.h +++ b/include/hw/audio/asc.h @@ -61,7 +61,7 @@ struct ASCState { MemoryRegion mem_regs; MemoryRegion mem_extregs; =20 - QEMUSoundCard card; + AudioFE card; SWVoiceOut *voice; uint8_t *mixbuf; int samples; diff --git a/include/hw/audio/virtio-snd.h b/include/hw/audio/virtio-snd.h index 8dafedb276..f9a434fe26 100644 --- a/include/hw/audio/virtio-snd.h +++ b/include/hw/audio/virtio-snd.h @@ -216,7 +216,7 @@ struct VirtIOSound { VirtQueue *queues[VIRTIO_SND_VQ_MAX]; uint64_t features; VirtIOSoundPCM *pcm; - QEMUSoundCard card; + AudioFE card; VMChangeStateEntry *vmstate; virtio_snd_config snd_conf; QemuMutex cmdq_mutex; diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index e86a87f235..196f325f52 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -84,7 +84,7 @@ struct XlnxDPState { struct PixmanPlane v_plane; struct PixmanPlane bout_plane; =20 - QEMUSoundCard aud_card; + AudioFE aud_card; SWVoiceOut *amixer_output_stream; int16_t audio_buffer_0[AUD_CHBUF_MAX_DEPTH]; int16_t audio_buffer_1[AUD_CHBUF_MAX_DEPTH]; diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index da1722daf2..9948daaefb 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -24,7 +24,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ViaAC97State, VIA_AC97); =20 struct ViaAC97State { PCIDevice dev; - QEMUSoundCard card; + AudioFE card; MemoryRegion sgd; MemoryRegion fm; MemoryRegion midi; diff --git a/include/hw/qdev-properties-system.h b/include/hw/qdev-properti= es-system.h index 9601a11a09..cf1839b14d 100644 --- a/include/hw/qdev-properties-system.h +++ b/include/hw/qdev-properties-system.h @@ -87,7 +87,7 @@ extern const PropertyInfo qdev_prop_virtio_gpu_output_lis= t; .set_default =3D true) =20 #define DEFINE_PROP_AUDIODEV(_n, _s, _f) \ - DEFINE_PROP(_n, _s, _f, qdev_prop_audiodev, QEMUSoundCard) + DEFINE_PROP(_n, _s, _f, qdev_prop_audiodev, AudioFE) =20 #define DEFINE_PROP_UUID_NODEFAULT(_name, _state, _field) \ DEFINE_PROP(_name, _state, _field, qdev_prop_uuid, QemuUUID) diff --git a/audio/audio.c b/audio/audio.c index 66a2e86f13..7463bbd283 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1620,7 +1620,7 @@ static void audio_be_init(Object *obj) QLIST_INIT (&s->hw_head_out); QLIST_INIT (&s->hw_head_in); QLIST_INIT (&s->cap_head); - QLIST_INIT (&s->card_head); + QLIST_INIT (&s->fe_head); s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); =20 s->vmse =3D qemu_add_vm_change_state_handler(audio_vm_change_state_han= dler, s); @@ -1812,7 +1812,7 @@ AudioBE *audio_get_default_audio_be(Error **errp) return default_audio_be; } =20 -bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p) +bool AUD_register_fe (const char *name, AudioFE *card, Error **errp) { if (!card->be) { card->be =3D audio_get_default_audio_be(errp); @@ -1823,12 +1823,12 @@ bool AUD_register_card (const char *name, QEMUSound= Card *card, Error **errp) =20 card->name =3D g_strdup (name); memset (&card->entries, 0, sizeof (card->entries)); - QLIST_INSERT_HEAD(&card->be->card_head, card, entries); + QLIST_INSERT_HEAD(&card->be->fe_head, card, entries); =20 return true; } =20 -void AUD_remove_card (QEMUSoundCard *card) +void AUD_unregister_fe (AudioFE *card) { QLIST_REMOVE (card, entries); g_free (card->name); @@ -2232,7 +2232,7 @@ AudioBE *audio_be_by_name(const char *name, Error **e= rrp) } } =20 -const char *audio_get_id(QEMUSoundCard *card) +const char *audio_get_id(AudioFE *card) { if (card->be) { assert(card->be->dev); diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 1b2ce601a6..9520c6884c 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -120,7 +120,7 @@ typedef struct AC97BusMasterRegs { =20 struct AC97LinkState { PCIDevice dev; - QEMUSoundCard card; + AudioFE card; uint32_t glob_cnt; uint32_t glob_sta; uint32_t cas; @@ -1271,7 +1271,7 @@ static void ac97_realize(PCIDevice *dev, Error **errp) AC97LinkState *s =3D AC97(dev); uint8_t *c =3D s->dev.config; =20 - if (!AUD_register_card ("ac97", &s->card, errp)) { + if (!AUD_register_fe ("ac97", &s->card, errp)) { return; } =20 @@ -1319,7 +1319,7 @@ static void ac97_exit(PCIDevice *dev) AUD_close_in(&s->card, s->voice_pi); AUD_close_out(&s->card, s->voice_po); AUD_close_in(&s->card, s->voice_mc); - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); } =20 static const Property ac97_properties[] =3D { diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 231055b8b5..a1eb356acc 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -53,7 +53,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AdlibState, ADLIB) struct AdlibState { ISADevice parent_obj; =20 - QEMUSoundCard card; + AudioFE card; uint32_t freq; uint32_t port; int ticking[2]; @@ -236,7 +236,7 @@ static void Adlib_fini (AdlibState *s) =20 s->active =3D 0; s->enabled =3D 0; - AUD_remove_card (&s->card); + AUD_unregister_fe (&s->card); } =20 static MemoryRegionPortio adlib_portio_list[] =3D { @@ -251,7 +251,7 @@ static void adlib_realizefn (DeviceState *dev, Error **= errp) AdlibState *s =3D ADLIB(dev); struct audsettings as; =20 - if (!AUD_register_card ("adlib", &s->card, errp)) { + if (!AUD_register_fe ("adlib", &s->card, errp)) { return; } =20 diff --git a/hw/audio/asc.c b/hw/audio/asc.c index 991316e984..791c4372ec 100644 --- a/hw/audio/asc.c +++ b/hw/audio/asc.c @@ -635,7 +635,7 @@ static void asc_unrealize(DeviceState *dev) g_free(s->mixbuf); g_free(s->silentbuf); =20 - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); } =20 static void asc_realize(DeviceState *dev, Error **errp) @@ -643,7 +643,7 @@ static void asc_realize(DeviceState *dev, Error **errp) ASCState *s =3D ASC(dev); struct audsettings as; =20 - if (!AUD_register_card("Apple Sound Chip", &s->card, errp)) { + if (!AUD_register_fe("Apple Sound Chip", &s->card, errp)) { return; } =20 @@ -655,7 +655,7 @@ static void asc_realize(DeviceState *dev, Error **errp) s->voice =3D AUD_open_out(&s->card, s->voice, "asc.out", s, asc_out_cb, &as); if (!s->voice) { - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); error_setg(errp, "Initializing audio stream failed"); return; } diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 062af7628b..01c1cd171e 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -65,7 +65,7 @@ DECLARE_INSTANCE_CHECKER(CSState, CS4231A, =20 struct CSState { ISADevice dev; - QEMUSoundCard card; + AudioFE card; MemoryRegion ioports; qemu_irq pic; uint32_t regs[CS_REGS]; @@ -674,7 +674,7 @@ static void cs4231a_realizefn (DeviceState *dev, Error = **errp) return; } =20 - if (!AUD_register_card ("cs4231a", &s->card, errp)) { + if (!AUD_register_fe ("cs4231a", &s->card, errp)) { return; } =20 diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index ac5a6aba85..e606bdb622 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -258,7 +258,7 @@ struct chan { =20 struct ES1370State { PCIDevice dev; - QEMUSoundCard card; + AudioFE card; MemoryRegion io; struct chan chan[NB_CHANNELS]; SWVoiceOut *dac_voice[2]; @@ -833,7 +833,7 @@ static void es1370_realize(PCIDevice *dev, Error **errp) ES1370State *s =3D ES1370(dev); uint8_t *c =3D s->dev.config; =20 - if (!AUD_register_card ("es1370", &s->card, errp)) { + if (!AUD_register_fe ("es1370", &s->card, errp)) { return; } =20 @@ -865,7 +865,7 @@ static void es1370_exit(PCIDevice *dev) } =20 AUD_close_in(&s->card, s->adc_voice); - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); } =20 static const Property es1370_properties[] =3D { diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 40073f2d4f..dcf936a85d 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -45,7 +45,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(GUSState, GUS) struct GUSState { ISADevice dev; GUSEmuState emu; - QEMUSoundCard card; + AudioFE card; uint32_t freq; uint32_t port; int pos, left, shift, irqs; @@ -238,7 +238,7 @@ static void gus_realizefn (DeviceState *dev, Error **er= rp) IsaDmaClass *k; struct audsettings as; =20 - if (!AUD_register_card ("gus", &s->card, errp)) { + if (!AUD_register_fe ("gus", &s->card, errp)) { return; } =20 @@ -263,7 +263,7 @@ static void gus_realizefn (DeviceState *dev, Error **er= rp) ); =20 if (!s->voice) { - AUD_remove_card (&s->card); + AUD_unregister_fe (&s->card); error_setg(errp, "No voice"); return; } diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index cc87557954..760fa7680e 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -178,7 +178,7 @@ struct HDAAudioState { HDACodecDevice hda; const char *name; =20 - QEMUSoundCard card; + AudioFE card; const desc_codec *desc; HDAAudioStream st[4]; bool running_compat[16]; @@ -696,7 +696,7 @@ static void hda_audio_init(HDACodecDevice *hda, const desc_param *param; uint32_t i, type; =20 - if (!AUD_register_card("hda", &a->card, errp)) { + if (!AUD_register_fe("hda", &a->card, errp)) { return; } =20 @@ -759,7 +759,7 @@ static void hda_audio_exit(HDACodecDevice *hda) AUD_close_in(&a->card, st->voice.in); } } - AUD_remove_card(&a->card); + AUD_unregister_fe(&a->card); } =20 static int hda_audio_post_load(void *opaque, int version) diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index dccbf56068..21e848ef24 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -282,7 +282,7 @@ void lm4549_init(lm4549_state *s, lm4549_callback data_= req_cb, void* opaque, struct audsettings as; =20 /* Register an audio card */ - if (!AUD_register_card("lm4549", &s->card, errp)) { + if (!AUD_register_fe("lm4549", &s->card, errp)) { return; } =20 diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index e9ab5ac41b..6e510f0be7 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -48,7 +48,7 @@ struct PCSpkState { MemoryRegion ioport; uint32_t iobase; uint8_t sample_buf[PCSPK_BUF_LEN]; - QEMUSoundCard card; + AudioFE card; SWVoiceOut *voice; PITCommonState *pit; unsigned int pit_count; @@ -188,7 +188,7 @@ static void pcspk_realizefn(DeviceState *dev, Error **e= rrp) =20 isa_register_ioport(isadev, &s->ioport, s->iobase); =20 - if (s->card.be && AUD_register_card(s_spk, &s->card, errp)) { + if (s->card.be && AUD_register_fe(s_spk, &s->card, errp)) { pcspk_audio_init(s); } } diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 069cf6e120..85f859a461 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -50,7 +50,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(SB16State, SB16) struct SB16State { ISADevice parent_obj; =20 - QEMUSoundCard card; + AudioFE card; qemu_irq pic; uint32_t irq; uint32_t dma; @@ -1397,7 +1397,7 @@ static void sb16_realizefn (DeviceState *dev, Error *= *errp) SB16State *s =3D SB16 (dev); IsaDmaClass *k; =20 - if (!AUD_register_card ("sb16", &s->card, errp)) { + if (!AUD_register_fe ("sb16", &s->card, errp)) { return; } =20 diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c index 62341e5600..1063a63742 100644 --- a/hw/audio/via-ac97.c +++ b/hw/audio/via-ac97.c @@ -426,7 +426,7 @@ static void via_ac97_realize(PCIDevice *pci_dev, Error = **errp) ViaAC97State *s =3D VIA_AC97(pci_dev); Object *o =3D OBJECT(s); =20 - if (!AUD_register_card ("via-ac97", &s->card, errp)) { + if (!AUD_register_fe ("via-ac97", &s->card, errp)) { return; } =20 @@ -456,7 +456,7 @@ static void via_ac97_exit(PCIDevice *dev) ViaAC97State *s =3D VIA_AC97(dev); =20 AUD_close_out(&s->card, s->vo); - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); } =20 static const Property via_ac97_properties[] =3D { diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index 88777977a9..15048e323a 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -1053,7 +1053,7 @@ static void virtio_snd_realize(DeviceState *dev, Erro= r **errp) return; } =20 - if (!AUD_register_card("virtio-sound", &vsnd->card, errp)) { + if (!AUD_register_fe("virtio-sound", &vsnd->card, errp)) { return; } =20 @@ -1330,7 +1330,7 @@ static void virtio_snd_unrealize(DeviceState *dev) g_free(vsnd->pcm); vsnd->pcm =3D NULL; } - AUD_remove_card(&vsnd->card); + AUD_unregister_fe(&vsnd->card); qemu_mutex_destroy(&vsnd->cmdq_mutex); virtio_delete_queue(vsnd->queues[VIRTIO_SND_VQ_CONTROL]); virtio_delete_queue(vsnd->queues[VIRTIO_SND_VQ_EVENT]); diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 7a36c4bd3f..d24fca37e1 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -34,7 +34,7 @@ struct WM8750State { =20 uint8_t i2c_data[2]; int i2c_len; - QEMUSoundCard card; + AudioFE card; SWVoiceIn *adc_voice[IN_PORT_N]; SWVoiceOut *dac_voice[OUT_PORT_N]; int enable; @@ -624,7 +624,7 @@ static void wm8750_realize(DeviceState *dev, Error **er= rp) { WM8750State *s =3D WM8750(dev); =20 - if (!AUD_register_card(CODEC, &s->card, errp)) { + if (!AUD_register_fe(CODEC, &s->card, errp)) { return; } =20 @@ -637,7 +637,7 @@ static void wm8750_fini(I2CSlave *i2c) WM8750State *s =3D WM8750(i2c); =20 wm8750_reset(I2C_SLAVE(s)); - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); g_free(s); } #endif diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index be682895f7..fc8e5eb07a 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -487,7 +487,7 @@ static void get_audiodev(Object *obj, Visitor *v, const= char* name, void *opaque, Error **errp) { const Property *prop =3D opaque; - QEMUSoundCard *card =3D object_field_prop_ptr(obj, prop); + AudioFE *card =3D object_field_prop_ptr(obj, prop); char *p =3D g_strdup(audio_get_id(card)); =20 visit_type_str(v, name, &p, errp); @@ -498,7 +498,7 @@ static void set_audiodev(Object *obj, Visitor *v, const= char* name, void *opaque, Error **errp) { const Property *prop =3D opaque; - QEMUSoundCard *card =3D object_field_prop_ptr(obj, prop); + AudioFE *card =3D object_field_prop_ptr(obj, prop); AudioBE *state; g_autofree char *str =3D NULL; =20 diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 882ae3c4b4..41502ec3f5 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1306,7 +1306,7 @@ static void xlnx_dp_realize(DeviceState *dev, Error *= *errp) DisplaySurface *surface; struct audsettings as; =20 - if (!AUD_register_card("xlnx_dp.audio", &s->aud_card, errp)) { + if (!AUD_register_fe("xlnx_dp.audio", &s->aud_card, errp)) { return; } =20 diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index f59e5a53f0..2eb49a5e33 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -635,7 +635,7 @@ static uint8_t *streambuf_get(struct streambuf *buf, si= ze_t *len) struct USBAudioState { /* qemu interfaces */ USBDevice dev; - QEMUSoundCard card; + AudioFE card; =20 /* state */ struct { @@ -932,7 +932,7 @@ static void usb_audio_unrealize(USBDevice *dev) =20 usb_audio_set_output_altset(s, ALTSET_OFF); AUD_close_out(&s->card, s->out.voice); - AUD_remove_card(&s->card); + AUD_unregister_fe(&s->card); =20 streambuf_fini(&s->out.buf); } @@ -942,7 +942,7 @@ static void usb_audio_realize(USBDevice *dev, Error **e= rrp) USBAudioState *s =3D USB_AUDIO(dev); int i; =20 - if (!AUD_register_card(TYPE_USB_AUDIO, &s->card, errp)) { + if (!AUD_register_fe(TYPE_USB_AUDIO, &s->card, errp)) { return; } =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037847; cv=none; d=zohomail.com; s=zohoarc; b=He9ijRU6sSnL9XgHJr7iaxJ0SLYFcpOj9XGpbJLgJCvCQMOw2v732SYMYl8a/Gm+yy6JR1HOkyOeSd0xaj318FIvI+MsldKCNyYo2hQJ+UZd3Og2POw/Wn8LLC4mhgaNRq4Po6h9j7UxnDMT1ra4RzJD+M2wxShWmnALipJIN/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037847; 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=1+QYez7Jzo8MSmdV9f2wjA9ZiZxwt3D7e37RqxqJ5V8=; b=IgyF8GxDNDYRoupuTy5kdoA5PcYQvDBuWHjwyrz6P8ADmAxqdbGWH6F//ZB5h+hkLEQ6KOvRTfUpTAvuAtah3SRDuBsM1AqrblimQK+pstpcH071jr0kirDcsgvH+Y2iLKzUTEOmW5Penq22C1R/+zk+xhs5g8UYDSqzXTHGmfk= 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 1761037847123169.53918571278325; Tue, 21 Oct 2025 02:10:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Kp-0006w6-JC; Tue, 21 Oct 2025 05:07:15 -0400 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 1vB8KW-0006oO-Tt for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8KO-0004OR-W2 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:56 -0400 Received: from mx-prod-mc-05.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-538-VEtmlA0OMnWMYR0KZNIw1g-1; Tue, 21 Oct 2025 05:06:46 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8884619560A2; Tue, 21 Oct 2025 09:06:41 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 447E71955F22; Tue, 21 Oct 2025 09:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037608; 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=1+QYez7Jzo8MSmdV9f2wjA9ZiZxwt3D7e37RqxqJ5V8=; b=eGnRh6pxTVTQrsEwBVPtNILzcreNwBIIfu9UDu9HLQa/gBHZwyveTM3VfsQUNXqhoYegTC MipYbwF6F4f36tXZLVoKukEa+ez9P+I7xNv7Ic4WCOBQ2CwEU5h2+MwjREaZk4VrJpSl47 mRuE35kSfTFQzmqpXeBl0ay8BPidxmo= X-MC-Unique: VEtmlA0OMnWMYR0KZNIw1g-1 X-Mimecast-MFC-AGG-ID: VEtmlA0OMnWMYR0KZNIw1g_1761037601 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 36/43] audio: rename audio_get_id() Date: Tue, 21 Oct 2025 13:03:07 +0400 Message-ID: <20251021090317.425409-37-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037850328158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 2 +- audio/audio.c | 2 +- hw/core/qdev-properties-system.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index a43ca0700c..85e588a885 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -156,7 +156,7 @@ void audio_help(void); =20 AudioBE *audio_be_by_name(const char *name, Error **errp); AudioBE *audio_get_default_audio_be(Error **errp); -const char *audio_get_id(AudioFE *fe); +const char *audio_fe_get_be_id(AudioFE *fe); =20 #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) diff --git a/audio/audio.c b/audio/audio.c index 7463bbd283..35753ebb97 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2232,7 +2232,7 @@ AudioBE *audio_be_by_name(const char *name, Error **e= rrp) } } =20 -const char *audio_get_id(AudioFE *card) +const char *audio_fe_get_be_id(AudioFE *card) { if (card->be) { assert(card->be->dev); diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index fc8e5eb07a..701f6553c5 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -488,7 +488,7 @@ static void get_audiodev(Object *obj, Visitor *v, const= char* name, { const Property *prop =3D opaque; AudioFE *card =3D object_field_prop_ptr(obj, prop); - char *p =3D g_strdup(audio_get_id(card)); + char *p =3D g_strdup(audio_fe_get_be_id(card)); =20 visit_type_str(v, name, &p, errp); g_free(p); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037893; cv=none; d=zohomail.com; s=zohoarc; b=Z6EO4wrtvhp7CnqPzeg/jCqvPhUoWd7Flpw439ReXMCy3SM5kbxFR+MbZ3ZiHbuFouvDe3wBXJfYMAL5zo7KJk3KaJJLqCFFjJ6eiudtWq0X0q0QuvA142O8inOk4uSTZvRZRE1bHOGYcnpxHiJUYpIdAjF9+Jz1ycqjlmm+Rk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037893; 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=2dFt3SyQn/4VSg6MIGWMIRzoazNm5yv+QD/kuyUHOcI=; b=Nf8sKpeQamQocFyeFilnidnyxubqBR6n9zlu5T189Hu2JMf90EOn0ACJRx7gEBapflZDs9aXPTpVbSjLkT70d6bhUavaT6embXuYRZRyIsKl/YsZkWgmB7OQ7jLKCq4cMXMXcNW2D8E6977kUCYBb6PlESqygx1WQ7B1jksl1io= 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 1761037893523231.83719793421858; Tue, 21 Oct 2025 02:11:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Kr-00071o-S5; Tue, 21 Oct 2025 05:07:17 -0400 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 1vB8KV-0006oB-4A for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8KS-0004Ow-Q7 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:06:54 -0400 Received: from mx-prod-mc-03.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-34-PDF8AoglMmyx1vvBnza2wQ-1; Tue, 21 Oct 2025 05:06:48 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E95D719560B7; Tue, 21 Oct 2025 09:06:46 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A5FC619560A2; Tue, 21 Oct 2025 09:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037611; 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=2dFt3SyQn/4VSg6MIGWMIRzoazNm5yv+QD/kuyUHOcI=; b=HCTjstycEmTZl3weF5hAHzfbdpXdl6r4ePLgZ72c4sRBfOG3Hdl31MV2nvghnbR3Dz6N5h NMI44Z77BMMxrbtHhvL2tohYSrW4+95GLENunGL+RIGWn2HobFBP2056cwFQWnkhEr3Qm/ F/mZOIMbLfAdb/Ov7cqsxP0b56oStSU= X-MC-Unique: PDF8AoglMmyx1vvBnza2wQ-1 X-Mimecast-MFC-AGG-ID: PDF8AoglMmyx1vvBnza2wQ_1761037607 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 37/43] audio/dbus: use a helper function to set the backend dbus server Date: Tue, 21 Oct 2025 13:03:08 +0400 Message-ID: <20251021090317.425409-38-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.12 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037895110154100 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 6 ++++++ audio/audio_int.h | 2 +- audio/audio.c | 14 ++++++++++++++ audio/dbusaudio.c | 6 ++++-- ui/dbus.c | 8 +------- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index 85e588a885..1f37cc3164 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -28,6 +28,9 @@ #include "qemu/queue.h" #include "qapi/qapi-types-audio.h" #include "hw/qdev-properties-system.h" +#ifdef CONFIG_GIO +#include "gio/gio.h" +#endif =20 typedef void (*audio_callback_fn) (void *opaque, int avail); =20 @@ -157,6 +160,9 @@ void audio_help(void); AudioBE *audio_be_by_name(const char *name, Error **errp); AudioBE *audio_get_default_audio_be(Error **errp); const char *audio_fe_get_be_id(AudioFE *fe); +#ifdef CONFIG_GIO +bool audio_be_set_dbus_server(AudioBE *be, GDBusObjectManagerServer *serve= r, bool p2p, Error **errp); +#endif =20 #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) diff --git a/audio/audio_int.h b/audio/audio_int.h index 5943dc3b2a..8c2dae21ab 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -147,7 +147,7 @@ struct audio_driver { void *(*init) (Audiodev *, Error **); void (*fini) (void *); #ifdef CONFIG_GIO - void (*set_dbus_server) (AudioBE *s, GDBusObjectManagerServer *manager= , bool p2p); + bool (*set_dbus_server) (AudioBE *s, GDBusObjectManagerServer *manager= , bool p2p, Error **errp); #endif struct audio_pcm_ops *pcm_ops; int max_voices_out; diff --git a/audio/audio.c b/audio/audio.c index 35753ebb97..2207cad5d7 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2232,6 +2232,20 @@ AudioBE *audio_be_by_name(const char *name, Error **= errp) } } =20 +#ifdef CONFIG_GIO +bool audio_be_set_dbus_server(AudioBE *be, GDBusObjectManagerServer *serve= r, bool p2p, Error **errp) +{ + assert(be !=3D NULL); + + if (!be->drv->set_dbus_server) { + error_setg(errp, "Audiodev '%s' is not compatible with DBus", be->= dev->id); + return false; + } + + return be->drv->set_dbus_server(be, server, p2p, errp); +} +#endif + const char *audio_fe_get_be_id(AudioFE *card) { if (card->be) { diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 873f76a89e..3344cbb030 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -645,8 +645,8 @@ dbus_audio_register_in_listener(AudioBE *s, arg_listener, false); } =20 -static void -dbus_audio_set_server(AudioBE *s, GDBusObjectManagerServer *server, bool p= 2p) +static bool +dbus_audio_set_server(AudioBE *s, GDBusObjectManagerServer *server, bool p= 2p, Error **errp) { DBusAudio *da =3D s->drv_opaque; =20 @@ -669,6 +669,8 @@ dbus_audio_set_server(AudioBE *s, GDBusObjectManagerSer= ver *server, bool p2p) g_dbus_object_skeleton_add_interface(G_DBUS_OBJECT_SKELETON(da->audio), G_DBUS_INTERFACE_SKELETON(da->ifa= ce)); g_dbus_object_manager_server_export(da->server, da->audio); + + return true; } =20 static struct audio_pcm_ops dbus_pcm_ops =3D { diff --git a/ui/dbus.c b/ui/dbus.c index 962b4a8c1e..7d44287673 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -221,15 +221,9 @@ dbus_display_complete(UserCreatable *uc, Error **errp) =20 if (dd->audiodev && *dd->audiodev) { AudioBE *audio_be =3D audio_be_by_name(dd->audiodev, errp); - if (!audio_be) { + if (!audio_be || !audio_be_set_dbus_server(audio_be, dd->server, d= d->p2p, errp)) { return; } - if (!g_str_equal(audio_be->drv->name, "dbus")) { - error_setg(errp, "Audiodev '%s' is not compatible with DBus", - dd->audiodev); - return; - } - audio_be->drv->set_dbus_server(audio_be, dd->server, dd->p2p); } =20 consoles =3D g_array_new(FALSE, FALSE, sizeof(guint32)); --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037773; cv=none; d=zohomail.com; s=zohoarc; b=ANxQoGF3dQVhm9bn3QHDsyZcM1Rv2pqQKYZrNtiq1loTrVURqtavd+OHi/MyvCTqg9J8qFX2M4wL1cEy0rQdQvlpbFuKGS3mxDrbr6JiETmXdPS8E+hLRbNrV9Y04UpNmbmSY+EIPYhFnmHjH/TudtsDogIfIFPZAZc+ETrtBNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037773; 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=kXwPk9aTnx2TKggI8roMJ4sw1JMeeb0FGSPfIvdaNn4=; b=E332s0UuZs8iOTyzeH4H16n+448zJBMsdT0BTc/2MAkiYH4UU8qJMzjZwjy+kx1XY6QbpxWxLBEp87iuNEGEB1sPVDo5WqzvS6LUWQQ1qv4bp9uROkgmXAdVNRjUlTKcm/dU/mdBsD/NYrDwd+pTQIHdKZTVp6lKZ25KYpqqIB8= 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 1761037773668829.5325094991671; Tue, 21 Oct 2025 02:09:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ks-0007BC-HO; Tue, 21 Oct 2025 05:07:18 -0400 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 1vB8Km-0006v3-4i for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Kf-0004Pv-RM for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-xU8zSGhkMLOHiJS5V4Vqeg-1; Tue, 21 Oct 2025 05:06:58 -0400 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7EC121800D81; Tue, 21 Oct 2025 09:06:54 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6730D180057D; Tue, 21 Oct 2025 09:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037622; 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=kXwPk9aTnx2TKggI8roMJ4sw1JMeeb0FGSPfIvdaNn4=; b=AAFWBW9q1gtnPfYEutnpNs7jjZv/UR7ArCESGttquqzQ3IGS5DOeG7TPphR8LEu6fzdctO 9SDAbhEt6Y8jeKOuN7aX06xd8RljY4G5Ukg3ON/nfoXevGojjOysYhqoR32c9yijc0jw6o 6/NiWqwSXkaaHlA0cg6PDRglwW/jR10= X-MC-Unique: xU8zSGhkMLOHiJS5V4Vqeg-1 X-Mimecast-MFC-AGG-ID: xU8zSGhkMLOHiJS5V4Vqeg_1761037615 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Christian Schoenebeck , Akihiko Odaki , Thomas Huth , Alexandre Ratchov , Peter Maydell , Jan Kiszka , Alistair Francis , "Edgar E. Iglesias" , Laurent Vivier , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Manos Pitsidianakis , Jiaxun Yang , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org (open list:Integrator CP), qemu-ppc@nongnu.org (open list:PReP) Subject: [PATCH 38/43] audio: move audio.h under include/qemu/ Date: Tue, 21 Oct 2025 13:03:09 +0400 Message-ID: <20251021090317.425409-39-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037787938158500 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki --- audio/audio_int.h | 2 +- hw/audio/lm4549.h | 2 +- include/hw/audio/asc.h | 2 +- include/hw/audio/virtio-snd.h | 2 +- include/hw/display/xlnx_dp.h | 2 +- include/hw/isa/vt82c686.h | 2 +- {audio =3D> include/qemu}/audio.h | 0 include/system/replay.h | 2 +- ui/vnc.h | 2 +- audio/alsaaudio.c | 2 +- audio/audio.c | 2 +- audio/audio_win_int.c | 2 +- audio/dbusaudio.c | 2 +- audio/dsoundaudio.c | 2 +- audio/jackaudio.c | 2 +- audio/mixeng.c | 2 +- audio/noaudio.c | 2 +- audio/ossaudio.c | 2 +- audio/paaudio.c | 2 +- audio/pwaudio.c | 2 +- audio/sdlaudio.c | 2 +- audio/sndioaudio.c | 2 +- audio/spiceaudio.c | 2 +- audio/wavaudio.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 2 +- hw/arm/xlnx-zcu102.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/asc.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/hda-codec.c | 2 +- hw/audio/lm4549.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/sb16.c | 2 +- hw/audio/wm8750.c | 2 +- hw/core/machine.c | 2 +- hw/core/qdev-properties-system.c | 2 +- hw/ppc/prep.c | 2 +- hw/usb/dev-audio.c | 2 +- replay/replay-audio.c | 2 +- system/runstate.c | 2 +- system/vl.c | 2 +- ui/dbus.c | 3 +-- audio/coreaudio.m | 2 +- scripts/codeconverter/codeconverter/test_regexps.py | 2 +- 52 files changed, 51 insertions(+), 52 deletions(-) rename {audio =3D> include/qemu}/audio.h (100%) diff --git a/audio/audio_int.h b/audio/audio_int.h index 8c2dae21ab..4207bd0e12 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -29,7 +29,7 @@ #define FLOAT_MIXENG /* #define RECIPROCAL */ #endif -#include "audio.h" +#include "qemu/audio.h" #include "mixeng.h" =20 #ifdef CONFIG_GIO diff --git a/hw/audio/lm4549.h b/hw/audio/lm4549.h index 45023b6535..cd772ed945 100644 --- a/hw/audio/lm4549.h +++ b/hw/audio/lm4549.h @@ -12,7 +12,7 @@ #ifndef HW_LM4549_H #define HW_LM4549_H =20 -#include "audio/audio.h" +#include "qemu/audio.h" #include "exec/hwaddr.h" =20 typedef void (*lm4549_callback)(void *opaque); diff --git a/include/hw/audio/asc.h b/include/hw/audio/asc.h index 5c8c4ef4ec..b17ba8df41 100644 --- a/include/hw/audio/asc.h +++ b/include/hw/audio/asc.h @@ -14,7 +14,7 @@ #define HW_AUDIO_ASC_H =20 #include "hw/sysbus.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 #define ASC_FREQ 22257 =20 diff --git a/include/hw/audio/virtio-snd.h b/include/hw/audio/virtio-snd.h index f9a434fe26..09ecb5555a 100644 --- a/include/hw/audio/virtio-snd.h +++ b/include/hw/audio/virtio-snd.h @@ -17,7 +17,7 @@ #define QEMU_VIRTIO_SOUND_H =20 #include "hw/virtio/virtio.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/virtio_snd.h" =20 diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index 196f325f52..2d0e7384c0 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -33,7 +33,7 @@ #include "qemu/fifo8.h" #include "qemu/units.h" #include "hw/dma/xlnx_dpdma.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qom/object.h" #include "hw/ptimer.h" =20 diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index 9948daaefb..20e479be2b 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -2,7 +2,7 @@ #define HW_VT82C686_H =20 #include "hw/pci/pci_device.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 #define TYPE_VT82C686B_ISA "vt82c686b-isa" #define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci" diff --git a/audio/audio.h b/include/qemu/audio.h similarity index 100% rename from audio/audio.h rename to include/qemu/audio.h diff --git a/include/system/replay.h b/include/system/replay.h index 1e63c0784c..68f91bdfbf 100644 --- a/include/system/replay.h +++ b/include/system/replay.h @@ -16,7 +16,7 @@ #include "qapi/qapi-types-run-state.h" #include "qapi/qapi-types-ui.h" #include "block/aio.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 /* replay clock kinds */ enum ReplayClockKind { diff --git a/ui/vnc.h b/ui/vnc.h index a6aac50ec3..8ebf9901bc 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -31,7 +31,7 @@ #include "qemu/thread.h" #include "ui/clipboard.h" #include "ui/console.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qemu/bitmap.h" #include "crypto/tlssession.h" #include "qemu/buffer.h" diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 1c762e0e24..46798069e6 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -26,7 +26,7 @@ #include #include "qemu/main-loop.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" #include "trace.h" =20 #pragma GCC diagnostic ignored "-Waddress" diff --git a/audio/audio.c b/audio/audio.c index 2207cad5d7..60d4cfa2d2 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "audio.h" +#include "qemu/audio.h" #include "migration/vmstate.h" #include "qemu/timer.h" #include "qapi/error.h" diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c index 316f118f50..44a8ff24a6 100644 --- a/audio/audio_win_int.c +++ b/audio/audio_win_int.c @@ -7,7 +7,7 @@ #include #include =20 -#include "audio.h" +#include "qemu/audio.h" #include "audio_int.h" #include "audio_win_int.h" =20 diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 3344cbb030..972c0b9c7f 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -35,7 +35,7 @@ #include "ui/dbus-display1.h" =20 #define AUDIO_CAP "dbus" -#include "audio.h" +#include "qemu/audio.h" #include "audio_int.h" #include "trace.h" =20 diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 003ef27365..fbb8890f5c 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -27,7 +27,7 @@ */ =20 #include "qemu/osdep.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "dsound" #include "audio_int.h" diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 974a3caad3..28face9989 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -26,7 +26,7 @@ #include "qemu/module.h" #include "qemu/atomic.h" #include "qemu/main-loop.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "jack" #include "audio_int.h" diff --git a/audio/mixeng.c b/audio/mixeng.c index af9ec3d4d2..e63c76e021 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -24,7 +24,7 @@ */ #include "qemu/osdep.h" #include "qemu/bswap.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "mixeng" #include "audio_int.h" diff --git a/audio/noaudio.c b/audio/noaudio.c index 34ff1d2a27..b136b74e26 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "noaudio" #include "audio_int.h" diff --git a/audio/ossaudio.c b/audio/ossaudio.c index f202e743ff..7ae28c99bc 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -29,7 +29,7 @@ #include "qemu/module.h" #include "qemu/host-utils.h" #include "qapi/error.h" -#include "audio.h" +#include "qemu/audio.h" #include "trace.h" =20 #define AUDIO_CAP "oss" diff --git a/audio/paaudio.c b/audio/paaudio.c index 93030f3fc8..8eb80ede45 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -2,7 +2,7 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" #include "qapi/error.h" =20 #include diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 8e13b58286..8f6c0900c8 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -10,7 +10,7 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" #include "qemu/error-report.h" #include "qapi/error.h" #include diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 641357e5ee..4ef73c8dfb 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -27,7 +27,7 @@ #include #include "qemu/module.h" #include "qapi/error.h" -#include "audio.h" +#include "qemu/audio.h" =20 #ifndef _WIN32 #ifdef __sun__ diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c index 8eb35e1e53..f4f53b1c6f 100644 --- a/audio/sndioaudio.c +++ b/audio/sndioaudio.c @@ -18,7 +18,7 @@ #include #include #include "qemu/main-loop.h" -#include "audio.h" +#include "qemu/audio.h" #include "trace.h" =20 #define AUDIO_CAP "sndio" diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 7e737bff9a..77ba89ffaa 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -26,7 +26,7 @@ #include "ui/qemu-spice.h" =20 #define AUDIO_CAP "spice" -#include "audio.h" +#include "qemu/audio.h" #include "audio_int.h" =20 #if SPICE_INTERFACE_PLAYBACK_MAJOR > 1 || SPICE_INTERFACE_PLAYBACK_MINOR >= =3D 3 diff --git a/audio/wavaudio.c b/audio/wavaudio.c index a098b20cad..4d9c921305 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "wav" #include "audio_int.h" diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index b1d8fbd470..81ed051b98 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -26,7 +26,7 @@ #include "hw/irq.h" #include "hw/sd/sd.h" #include "qom/object.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "target/arm/cpu-qom.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 329b162eb2..6032301bb6 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -36,7 +36,7 @@ #include "qemu/cutils.h" #include "qom/object.h" #include "hw/net/mv88w8618_eth.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qemu/error-report.h" #include "target/arm/cpu-qom.h" =20 diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 5c9050490b..892bdc8db2 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -29,7 +29,7 @@ #include "hw/irq.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "target/arm/cpu-qom.h" =20 #define SMP_BOOT_ADDR 0xe0000000 diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 5cf1a70d10..cba77864e8 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -25,7 +25,7 @@ #include "hw/char/pl011.h" #include "hw/sd/sd.h" #include "qom/object.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "target/arm/cpu-qom.h" #include "qemu/log.h" =20 diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 35f8d05ea1..14d38cea8b 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -44,7 +44,7 @@ #include "hw/sd/sd.h" #include "qobject/qlist.h" #include "qom/object.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "target/arm/cpu-qom.h" =20 #define VEXPRESS_BOARD_ID 0x8e0 diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 14b6641a71..4ed346a88d 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -25,7 +25,7 @@ #include "system/device_tree.h" #include "qom/object.h" #include "net/can_emu.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 struct XlnxZCU102 { MachineState parent_obj; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 9520c6884c..13f9fab11a 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -19,7 +19,7 @@ =20 #include "qemu/osdep.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index a1eb356acc..ffc5e704db 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -26,7 +26,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "qemu/error-report.h" diff --git a/hw/audio/asc.c b/hw/audio/asc.c index 791c4372ec..124929d82d 100644 --- a/hw/audio/asc.c +++ b/hw/audio/asc.c @@ -15,7 +15,7 @@ #include "qapi/error.h" #include "hw/sysbus.h" #include "hw/irq.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/audio/asc.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 01c1cd171e..47843e4af6 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index e606bdb622..52c8f48a12 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -27,7 +27,7 @@ =20 #include "qemu/osdep.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qemu/cutils.h" diff --git a/hw/audio/gus.c b/hw/audio/gus.c index dcf936a85d..565935fef3 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -26,7 +26,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 760fa7680e..2658a73f46 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -25,7 +25,7 @@ #include "qemu/host-utils.h" #include "qemu/module.h" #include "intel-hda-defs.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "trace.h" #include "qom/object.h" =20 diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index 21e848ef24..f24426c7f1 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -15,7 +15,7 @@ =20 #include "qemu/osdep.h" #include "hw/hw.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "lm4549.h" #include "migration/vmstate.h" =20 diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index c5c79d083a..a483f4e70d 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -16,7 +16,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/audio/wm8750.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qapi/error.h" #include "qemu/module.h" #include "qom/object.h" diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 6e510f0be7..30eb22941a 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "hw/isa/isa.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qemu/module.h" #include "qemu/timer.h" #include "qemu/error-report.h" diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 85f859a461..cbef45722c 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index d24fca37e1..acdd1f93d0 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -12,7 +12,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "hw/audio/wm8750.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qom/object.h" =20 #define IN_PORT_N 3 diff --git a/hw/core/machine.c b/hw/core/machine.c index 2de8b89606..a82eb86415 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -36,7 +36,7 @@ #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" #include "hw/acpi/generic_event_device.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 GlobalProperty hw_compat_10_1[] =3D { { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 701f6553c5..d871863fcb 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -27,7 +27,7 @@ #include "qemu/error-report.h" #include "qdev-prop-internal.h" =20 -#include "audio/audio.h" +#include "qemu/audio.h" #include "chardev/char-fe.h" #include "system/block-backend.h" #include "system/blockdev.h" diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 982e40e53e..8e4ee71c0a 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -46,7 +46,7 @@ #include "trace.h" #include "elf.h" #include "qemu/units.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 /* SMP is not enabled, for now */ #define MAX_CPUS 1 diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 2eb49a5e33..22f025d6b2 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -35,7 +35,7 @@ #include "hw/usb.h" #include "migration/vmstate.h" #include "desc.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "qom/object.h" =20 static void usb_audio_reinit(USBDevice *dev, unsigned channels); diff --git a/replay/replay-audio.c b/replay/replay-audio.c index 3413801062..1b614f4137 100644 --- a/replay/replay-audio.c +++ b/replay/replay-audio.c @@ -13,7 +13,7 @@ #include "qemu/error-report.h" #include "system/replay.h" #include "replay-internal.h" -#include "audio/audio.h" +#include "qemu/audio.h" =20 void replay_audio_out(size_t *played) { diff --git a/system/runstate.c b/system/runstate.c index 32467aa882..e3ec16ab74 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "block/block.h" #include "block/export.h" #include "chardev/char.h" diff --git a/system/vl.c b/system/vl.c index 9245ec986c..7bc6c44ebe 100644 --- a/system/vl.c +++ b/system/vl.c @@ -87,7 +87,7 @@ #include "system/tpm.h" #include "system/dma.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "system/cpus.h" #include "system/cpu-timers.h" #include "exec/icount.h" diff --git a/ui/dbus.c b/ui/dbus.c index 7d44287673..096595cbcd 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -34,8 +34,7 @@ #include "ui/egl-helpers.h" #include "ui/egl-context.h" #endif -#include "audio/audio.h" -#include "audio/audio_int.h" +#include "qemu/audio.h" #include "qapi/error.h" #include "trace.h" =20 diff --git a/audio/coreaudio.m b/audio/coreaudio.m index cadd729d50..8b3cd6db16 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -28,7 +28,7 @@ =20 #include "qemu/main-loop.h" #include "qemu/module.h" -#include "audio.h" +#include "qemu/audio.h" =20 #define AUDIO_CAP "coreaudio" #include "audio_int.h" diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py index fe7354b473..b00e9ef15b 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -265,7 +265,7 @@ def test_initial_includes(): =20 #include "qemu/osdep.h" #include "hw/audio/model.h" -#include "audio/audio.h" +#include "qemu/audio.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/module.h" --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037967; cv=none; d=zohomail.com; s=zohoarc; b=alOGvIVwtVMjvpzUU+55ar75/FMG+Tx6YiA4XHdJ1pifWOSlCV+2TViPSyoDnQcYnQiGApzhuU6iJXTUhmUQkQVKgCMhvfjJ09Wl9QIZuxm++UxWK/AhyhC7yYsEv51WVHuFNi0AZPtnUEQ4TZcPazu6QfqlCeeVIwMBhTcwM3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037967; 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=alKpb0u140eXNITQrcibzH0f3MuJh6yEoE2ncrsRI7Y=; b=bukrUyd8yAWVk/o/jtmOwZt6EU71OoOEMF11l7FsH9Q+IXc4LhAXeR1aXodvrmGp3sXxuyAueievNFE2htaJ9I6+JeB6gTKzOeFvEB44FLoKrIWWYCh+RxKL/yYZuk1BQiAd8Wb/jxoNNQWQ7Gq/qnh3axw2wj+QJnmyW86DcrY= 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 1761037967305109.87891596532074; Tue, 21 Oct 2025 02:12:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Kv-0007Sg-Ja; Tue, 21 Oct 2025 05:07:21 -0400 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 1vB8Km-0006v1-4Y for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8Kh-0004QK-Mc for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-4xI97I0VPyGqcAtBkRwXJQ-1; Tue, 21 Oct 2025 05:07:01 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0B7A18002F7; Tue, 21 Oct 2025 09:06:59 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9DAA81955F22; Tue, 21 Oct 2025 09:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037626; 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=alKpb0u140eXNITQrcibzH0f3MuJh6yEoE2ncrsRI7Y=; b=NyyEN1sg1Xhl3cBZjijMmuashrdPF5px2YItVmju1GEDUcDfD0DUdUWJHZ3R8hCKE3eEJf 4aEW/y/IC/6zNc83aUI5yNAhqRcaeLTsV5hMvl3qQ+wRL7JCbSjZT7Swz0JNCVQ48PcChk fOM/vJGbtKIheAyrOFVoLGeh1xyfN14= X-MC-Unique: 4xI97I0VPyGqcAtBkRwXJQ-1 X-Mimecast-MFC-AGG-ID: 4xI97I0VPyGqcAtBkRwXJQ_1761037620 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 39/43] audio: remove dependency on spice header Date: Tue, 21 Oct 2025 13:03:10 +0400 Message-ID: <20251021090317.425409-40-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.17 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037967633158500 From: Marc-Andr=C3=A9 Lureau It is no longer required. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/meson.build b/audio/meson.build index 59f0a431d5..37789437fb 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -1,5 +1,5 @@ -system_ss.add([spice_headers, files('audio.c')]) system_ss.add(files( + 'audio.c', 'audio-hmp-cmds.c', 'mixeng.c', 'noaudio.c', --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037903; cv=none; d=zohomail.com; s=zohoarc; b=O7NGWELzK8/14t2gQG1Y9KLyglrk6Di/alcrQO63HqO4MYoZoTeTFboXd31tN/iMFWwkNPodoS3wp2SsD726XlptKfNjNxR6bNWvnk0H8cdgdW2uWd9Egiycx2AfKi6QwLaYpEOF46vrxP8ar2BrYjzvcfbkJer9vqIvB2+jyGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037903; 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=JWvZX5W+OFdx47fWl9fhvkk5aix5b5zMWoCfctFRYIo=; b=eWom2BuQJw6SAODqQvF8uJCIuDk6M+yGhdUMOY/VDb42sxxgpzraWdRqu//WF5Nx7Kbr8tqp7ZWYqnVOtBog0HjKx/LLMUQmiNgkS7fNZNuUUA/c0OG0xNCi9VlyWrPm876QPga3hxrLYkFCPpLR6q3w8RygwEqonYh2b6gdnMw= 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 1761037903119944.9286149616993; Tue, 21 Oct 2025 02:11:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ku-0007M9-M1; Tue, 21 Oct 2025 05:07:20 -0400 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 1vB8Ko-0006vG-31 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:14 -0400 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 1vB8Kl-0004QO-U2 for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:13 -0400 Received: from mx-prod-mc-04.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-611-zNdOZj7GN6mGyPJuBrf6Dw-1; Tue, 21 Oct 2025 05:07:06 -0400 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EDD0E1954190; Tue, 21 Oct 2025 09:07:04 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 00E04180035A; Tue, 21 Oct 2025 09:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037627; 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=JWvZX5W+OFdx47fWl9fhvkk5aix5b5zMWoCfctFRYIo=; b=Qr5votoIVjGAm7L5K0al3rdc96aeyVbpcg0677TBdMKmaXfZGYx82AbvdF6BUaPw3Wuo1c nhOxCOpM/4htccZ/+pPYAFjg0xIk/qsZrBemmQG7NXkiUvnSZpqWRsJ7Jysh6X3U1SWGg8 W7j7sIvbBQS39Md3c9f56FnqZ8fExTw= X-MC-Unique: zNdOZj7GN6mGyPJuBrf6Dw-1 X-Mimecast-MFC-AGG-ID: zNdOZj7GN6mGyPJuBrf6Dw_1761037625 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 40/43] audio: cleanup, use bool for booleans Date: Tue, 21 Oct 2025 13:03:11 +0400 Message-ID: <20251021090317.425409-41-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037905253154100 From: Marc-Andr=C3=A9 Lureau Use slightly better types for the job. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 12 ++++++------ audio/audio_template.h | 6 +++--- include/qemu/audio.h | 8 ++++---- audio/audio.c | 30 +++++++++++++++--------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 4207bd0e12..0116ee6707 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -67,9 +67,9 @@ typedef struct STSampleBuffer { =20 typedef struct HWVoiceOut { AudioBE *s; - int enabled; + bool enabled; int poll_mode; - int pending_disable; + bool pending_disable; struct audio_pcm_info info; =20 f_sample *clip; @@ -88,7 +88,7 @@ typedef struct HWVoiceOut { =20 typedef struct HWVoiceIn { AudioBE *s; - int enabled; + bool enabled; int poll_mode; struct audio_pcm_info info; =20 @@ -115,8 +115,8 @@ struct SWVoiceOut { STSampleBuffer resample_buf; void *rate; size_t total_hw_samples_mixed; - int active; - int empty; + bool active; + bool empty; HWVoiceOut *hw; char *name; struct mixeng_volume vol; @@ -127,7 +127,7 @@ struct SWVoiceOut { struct SWVoiceIn { AudioFE *card; AudioBE *s; - int active; + bool active; struct audio_pcm_info info; void *rate; size_t total_hw_samples_acquired; diff --git a/audio/audio_template.h b/audio/audio_template.h index e52587e02c..0d6450caed 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -166,10 +166,10 @@ static int glue (audio_pcm_sw_init_, TYPE) ( =20 audio_pcm_init_info (&sw->info, as); sw->hw =3D hw; - sw->active =3D 0; + sw->active =3D false; #ifdef DAC sw->total_hw_samples_mixed =3D 0; - sw->empty =3D 1; + sw->empty =3D true; #endif =20 if (sw->info.is_float) { @@ -566,7 +566,7 @@ SW *glue (AUD_open_, TYPE) ( return NULL; } =20 -int glue (AUD_is_active_, TYPE) (SW *sw) +bool glue (AUD_is_active_, TYPE) (SW *sw) { return sw ? sw->active : 0; } diff --git a/include/qemu/audio.h b/include/qemu/audio.h index 1f37cc3164..ab5367d28b 100644 --- a/include/qemu/audio.h +++ b/include/qemu/audio.h @@ -105,8 +105,8 @@ SWVoiceOut *AUD_open_out ( void AUD_close_out (AudioFE *fe, SWVoiceOut *sw); size_t AUD_write (SWVoiceOut *sw, void *pcm_buf, size_t size); int AUD_get_buffer_size_out (SWVoiceOut *sw); -void AUD_set_active_out (SWVoiceOut *sw, int on); -int AUD_is_active_out (SWVoiceOut *sw); +void AUD_set_active_out (SWVoiceOut *sw, bool on); +bool AUD_is_active_out (SWVoiceOut *sw); =20 void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); @@ -135,8 +135,8 @@ SWVoiceIn *AUD_open_in ( =20 void AUD_close_in (AudioFE *fe, SWVoiceIn *sw); size_t AUD_read (SWVoiceIn *sw, void *pcm_buf, size_t size); -void AUD_set_active_in (SWVoiceIn *sw, int on); -int AUD_is_active_in (SWVoiceIn *sw); +void AUD_set_active_in (SWVoiceIn *sw, bool on); +bool AUD_is_active_in (SWVoiceIn *sw); =20 void AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts); diff --git a/audio/audio.c b/audio/audio.c index 60d4cfa2d2..e03da8c344 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -405,7 +405,7 @@ static void audio_notify_capture (CaptureVoiceOut *cap,= audcnotification_e cmd) } } =20 -static void audio_capture_maybe_changed (CaptureVoiceOut *cap, int enabled) +static void audio_capture_maybe_changed (CaptureVoiceOut *cap, bool enable= d) { if (cap->hw.enabled !=3D enabled) { audcnotification_e cmd; @@ -419,11 +419,11 @@ static void audio_recalc_and_notify_capture (CaptureV= oiceOut *cap) { HWVoiceOut *hw =3D &cap->hw; SWVoiceOut *sw; - int enabled =3D 0; + bool enabled =3D false; =20 for (sw =3D hw->sw_head.lh_first; sw; sw =3D sw->entries.le_next) { if (sw->active) { - enabled =3D 1; + enabled =3D true; break; } } @@ -475,7 +475,7 @@ static int audio_attach_capture (HWVoiceOut *hw) sw =3D &sc->sw; sw->hw =3D hw_cap; sw->info =3D hw->info; - sw->empty =3D 1; + sw->empty =3D true; sw->active =3D hw->enabled; sw->vol =3D nominal_volume; sw->rate =3D st_rate_start (sw->info.freq, hw_cap->info.freq); @@ -911,7 +911,7 @@ int AUD_get_buffer_size_out(SWVoiceOut *sw) return sw->hw->samples * sw->hw->info.bytes_per_frame; } =20 -void AUD_set_active_out (SWVoiceOut *sw, int on) +void AUD_set_active_out (SWVoiceOut *sw, bool on) { HWVoiceOut *hw; =20 @@ -928,7 +928,7 @@ void AUD_set_active_out (SWVoiceOut *sw, int on) if (on) { hw->pending_disable =3D 0; if (!hw->enabled) { - hw->enabled =3D 1; + hw->enabled =3D true; if (s->vm_running) { if (hw->pcm_ops->enable_out) { hw->pcm_ops->enable_out(hw, true); @@ -959,7 +959,7 @@ void AUD_set_active_out (SWVoiceOut *sw, int on) } } =20 -void AUD_set_active_in (SWVoiceIn *sw, int on) +void AUD_set_active_in (SWVoiceIn *sw, bool on) { HWVoiceIn *hw; =20 @@ -974,7 +974,7 @@ void AUD_set_active_in (SWVoiceIn *sw, int on) =20 if (on) { if (!hw->enabled) { - hw->enabled =3D 1; + hw->enabled =3D true; if (s->vm_running) { if (hw->pcm_ops->enable_in) { hw->pcm_ops->enable_in(hw, true); @@ -993,7 +993,7 @@ void AUD_set_active_in (SWVoiceIn *sw, int on) } =20 if (nb_active =3D=3D 1) { - hw->enabled =3D 0; + hw->enabled =3D false; if (hw->pcm_ops->enable_in) { hw->pcm_ops->enable_in(hw, false); } @@ -1152,8 +1152,8 @@ static void audio_run_out (AudioBE *s) sw =3D hw->sw_head.lh_first; =20 if (hw->pending_disable) { - hw->enabled =3D 0; - hw->pending_disable =3D 0; + hw->enabled =3D false; + hw->pending_disable =3D false; if (hw->pcm_ops->enable_out) { hw->pcm_ops->enable_out(hw, false); } @@ -1206,13 +1206,13 @@ static void audio_run_out (AudioBE *s) #ifdef DEBUG_OUT dolog ("Disabling voice\n"); #endif - hw->enabled =3D 0; - hw->pending_disable =3D 0; + hw->enabled =3D false; + hw->pending_disable =3D false; if (hw->pcm_ops->enable_out) { hw->pcm_ops->enable_out(hw, false); } for (sc =3D hw->cap_head.lh_first; sc; sc =3D sc->entries.le_n= ext) { - sc->sw.active =3D 0; + sc->sw.active =3D false; audio_recalc_and_notify_capture (sc->cap); } continue; @@ -1257,7 +1257,7 @@ static void audio_run_out (AudioBE *s) sw->total_hw_samples_mixed -=3D played; =20 if (!sw->total_hw_samples_mixed) { - sw->empty =3D 1; + sw->empty =3D true; } } } --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037897; cv=none; d=zohomail.com; s=zohoarc; b=FSfWRRS/axzE/C0mObY7q+J3HCmVsDzjCBA+8qvMJ9/87ywUbp8Necih4nSdLl+4wdYF8PGfvh/BEE5kp6i/5aPhlENxVe1qhb78RJPtj1IMrne6irVwbd0SsBDFDRuLOvIqI2FWfyJMc2qVMYi5dc4mzuDQZST6/lbL9ONA6oY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037897; 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=CMw81vkVQi04474LbjAtyqfg7CC8nxWj8ZSHSjYZ4I8=; b=fiPAvKz1qZT9AENL6CEarsOx7d5EG/9swnH6FQ4MqHasdX2TCBMWhCMaNiWIw8eUvdFZXHkxIY3iWuCB3fh8tWJbub5h1/byCgjjHEnTXe/LslTTWnHL7G3MnqFdJoo33zSfH13uNd0jSVOGorZQPB0Joas02YV1TaR1aB6aGRA= 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 176103789760143.58793267266162; Tue, 21 Oct 2025 02:11:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8Ku-0007MA-MJ; Tue, 21 Oct 2025 05:07:20 -0400 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 1vB8Ks-0007Dc-Nz for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:18 -0400 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 1vB8Kq-0004RP-Kh for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:18 -0400 Received: from mx-prod-mc-02.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-621-IvOp5BhhOuuqWEv4nctYAg-1; Tue, 21 Oct 2025 05:07:11 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4C6191956096; Tue, 21 Oct 2025 09:07:10 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED74D1800451; Tue, 21 Oct 2025 09:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037635; 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=CMw81vkVQi04474LbjAtyqfg7CC8nxWj8ZSHSjYZ4I8=; b=MzYtnDpOgDlm8J375u3NdH9ouk0rxhSBN9oEtrkjOxKZoBpXOfpMSdQBPqisxnhWyUvQO2 bgHkUmYfw+ueLCWUWvXdm0r9DSe9qB6oGMxeZzRbHIoz8iK+A5uKJW52nwWAPbPXMcBiDU OHp6TLeOX9bwLUgr0q3g/HrMJwO44f8= X-MC-Unique: IvOp5BhhOuuqWEv4nctYAg-1 X-Mimecast-MFC-AGG-ID: IvOp5BhhOuuqWEv4nctYAg_1761037630 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 41/43] audio: drop needless list of FE Date: Tue, 21 Oct 2025 13:03:12 +0400 Message-ID: <20251021090317.425409-42-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.111 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037899147154100 From: Marc-Andr=C3=A9 Lureau Apparently, it was never used. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 1 - include/qemu/audio.h | 1 - audio/audio.c | 4 ---- 3 files changed, 6 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 0116ee6707..ef7a0de200 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -246,7 +246,6 @@ typedef struct AudioBE { void *drv_opaque; =20 QEMUTimer *ts; - QLIST_HEAD (fe_listhead, AudioFE) fe_head; QLIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in; QLIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out; QLIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head; diff --git a/include/qemu/audio.h b/include/qemu/audio.h index ab5367d28b..16c8877970 100644 --- a/include/qemu/audio.h +++ b/include/qemu/audio.h @@ -76,7 +76,6 @@ typedef struct AudioBE AudioBE; typedef struct AudioFE { char *name; AudioBE *be; - QLIST_ENTRY (AudioFE) entries; } AudioFE; =20 typedef struct QEMUAudioTimeStamp { diff --git a/audio/audio.c b/audio/audio.c index e03da8c344..7c7801a6ce 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1620,7 +1620,6 @@ static void audio_be_init(Object *obj) QLIST_INIT (&s->hw_head_out); QLIST_INIT (&s->hw_head_in); QLIST_INIT (&s->cap_head); - QLIST_INIT (&s->fe_head); s->ts =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer, s); =20 s->vmse =3D qemu_add_vm_change_state_handler(audio_vm_change_state_han= dler, s); @@ -1822,15 +1821,12 @@ bool AUD_register_fe (const char *name, AudioFE *ca= rd, Error **errp) } =20 card->name =3D g_strdup (name); - memset (&card->entries, 0, sizeof (card->entries)); - QLIST_INSERT_HEAD(&card->be->fe_head, card, entries); =20 return true; } =20 void AUD_unregister_fe (AudioFE *card) { - QLIST_REMOVE (card, entries); g_free (card->name); } =20 --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037863; cv=none; d=zohomail.com; s=zohoarc; b=BaJkT0jj4H1C0VzlIpfCqV+S6WurqQxlQ5+pKaMyorjmHtwgli8KLMdofS7vcfEEEPSokfRPoopt+ilq6GWjw5+EKtP31D8Q8ykwrITR1CCwuuxucTwwAlR47laR/CFmlamHLNhwFhNFzlcIw//NESKAc++v5Wr5xrnkto4saEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037863; 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=22a0insM+50eLf3LfN0tac94SvPSUaogq0VOtJx8xKo=; b=ITchtpiWyqrK5cFaw1NMtzgHX73gRk7YHtV25DlkBG98nWZoFOGv93sGwZnLBOureRFjqUFGXyrdZhta4VCxIb5bZvLspvCXxAGAM18eCBerNx3MgsmyGxeZ7z1Dt/4VtT4MUdSjWCYmyCHL6czF84IXmWykZeQTH1Yi/+Gv9Vw= 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 1761037863033717.7142898316764; Tue, 21 Oct 2025 02:11:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8L6-0008IS-E3; Tue, 21 Oct 2025 05:07:32 -0400 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 1vB8L3-00086c-UK for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vB8L0-0004TN-Kf for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:29 -0400 Received: from mx-prod-mc-05.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-526-PI9iVaOWNsybpeGgqUW_Qw-1; Tue, 21 Oct 2025 05:07:16 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B641319560AA; Tue, 21 Oct 2025 09:07:15 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6334A19560A2; Tue, 21 Oct 2025 09:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037644; 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=22a0insM+50eLf3LfN0tac94SvPSUaogq0VOtJx8xKo=; b=Ksx0+0P8B20Dbi6JwYbjs63UaDsHrHkRDz1WaUaj2u+Puezi74cP1DCNs/n5rm7Elqt+2V l1L3eu9wb+RessFGm2e7kclHsQTc11GAvVkQ/NkTzcgh352Rt+lvhjQknIqywWQYsyGAeB tUc2PCqvgqnTDU/jUAZPb1K7nwNnjIc= X-MC-Unique: PI9iVaOWNsybpeGgqUW_Qw-1 X-Mimecast-MFC-AGG-ID: PI9iVaOWNsybpeGgqUW_Qw_1761037635 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [PATCH 42/43] audio: move capture API to own header Date: Tue, 21 Oct 2025 13:03:13 +0400 Message-ID: <20251021090317.425409-43-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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.0 on 10.30.177.12 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037864701154100 From: Marc-Andr=C3=A9 Lureau For modularity/clarity reasons, move the capture API in a specific header. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 1 + include/qemu/audio-capture.h | 43 ++++++++++++++++++++++++++++++++++++ include/qemu/audio.h | 30 ------------------------- ui/vnc.h | 2 +- 4 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 include/qemu/audio-capture.h diff --git a/audio/audio_int.h b/audio/audio_int.h index ef7a0de200..67da5ec6da 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -30,6 +30,7 @@ /* #define RECIPROCAL */ #endif #include "qemu/audio.h" +#include "qemu/audio-capture.h" #include "mixeng.h" =20 #ifdef CONFIG_GIO diff --git a/include/qemu/audio-capture.h b/include/qemu/audio-capture.h new file mode 100644 index 0000000000..7122afd385 --- /dev/null +++ b/include/qemu/audio-capture.h @@ -0,0 +1,43 @@ +/* + * QEMU Audio subsystem + * + * SPDX-License-Identifier: MIT + */ +#ifndef QEMU_AUDIO_CAPTURE_H +#define QEMU_AUDIO_CAPTURE_H + +#include "audio.h" + +typedef struct CaptureVoiceOut CaptureVoiceOut; + +typedef enum { + AUD_CNOTIFY_ENABLE, + AUD_CNOTIFY_DISABLE +} audcnotification_e; + +struct audio_capture_ops { + void (*notify) (void *opaque, audcnotification_e cmd); + void (*capture) (void *opaque, const void *buf, int size); + void (*destroy) (void *opaque); +}; + +struct capture_ops { + void (*info) (void *opaque); + void (*destroy) (void *opaque); +}; + +typedef struct CaptureState { + void *opaque; + struct capture_ops ops; + QLIST_ENTRY (CaptureState) entries; +} CaptureState; + +CaptureVoiceOut *AUD_add_capture( + AudioBE *s, + struct audsettings *as, + struct audio_capture_ops *ops, + void *opaque + ); +void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque); + +#endif /* QEMU_AUDIO_CAPTURE_H */ diff --git a/include/qemu/audio.h b/include/qemu/audio.h index 16c8877970..753e18c17c 100644 --- a/include/qemu/audio.h +++ b/include/qemu/audio.h @@ -41,30 +41,7 @@ typedef struct audsettings { int endianness; } audsettings; =20 -typedef enum { - AUD_CNOTIFY_ENABLE, - AUD_CNOTIFY_DISABLE -} audcnotification_e; - -struct audio_capture_ops { - void (*notify) (void *opaque, audcnotification_e cmd); - void (*capture) (void *opaque, const void *buf, int size); - void (*destroy) (void *opaque); -}; - -struct capture_ops { - void (*info) (void *opaque); - void (*destroy) (void *opaque); -}; - -typedef struct CaptureState { - void *opaque; - struct capture_ops ops; - QLIST_ENTRY (CaptureState) entries; -} CaptureState; - typedef struct SWVoiceOut SWVoiceOut; -typedef struct CaptureVoiceOut CaptureVoiceOut; typedef struct SWVoiceIn SWVoiceIn; =20 typedef struct AudioBEClass AudioBEClass; @@ -84,13 +61,6 @@ typedef struct QEMUAudioTimeStamp { =20 bool AUD_register_fe (const char *name, AudioFE *fe, Error **errp); void AUD_unregister_fe (AudioFE *fe); -CaptureVoiceOut *AUD_add_capture( - AudioBE *s, - struct audsettings *as, - struct audio_capture_ops *ops, - void *opaque - ); -void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque); =20 SWVoiceOut *AUD_open_out ( AudioFE *fe, diff --git a/ui/vnc.h b/ui/vnc.h index 8ebf9901bc..87c8cf11e4 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -31,7 +31,7 @@ #include "qemu/thread.h" #include "ui/clipboard.h" #include "ui/console.h" -#include "qemu/audio.h" +#include "qemu/audio-capture.h" #include "qemu/bitmap.h" #include "crypto/tlssession.h" #include "qemu/buffer.h" --=20 2.51.0 From nobody Thu Oct 30 15:35:57 2025 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=1761037729; cv=none; d=zohomail.com; s=zohoarc; b=eT0wnpWCtOeDOdGQNtAPCua/o7ybWJt28IxjBEl+Nn0eZEI5aELq6xM06LBskJ1VwbYeOXitKaDqLWGES5PEPsouEbv04tJgUlqIsEG1p6DdeHCholZk8aKVxPNUPlaKR546gVOJQE6QdggAiI7FeUO8m8j0meWwnsmSIMnBJe8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761037729; 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=VW6PPOpSHOH3ehcMkX1Wx0+f+DPv/fFrft3dQrbw4og=; b=mS3muVcQklHLov/2V6GcCgargpNEva6xrSFyzcmRgdOnSKLDUtuVxr0eJU9ftGcstLd4A4QK/l8i/Kdyg6m21+ZTLarbqTlFRC3gy5/t0WXuFaCGc4XY6+gy8I52iugOxTHVPDwK9VfyEmfilgn6JfPbqcFn6eXh3pU3Gooo/oA= 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 176103772903055.302732440685304; Tue, 21 Oct 2025 02:08:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vB8LA-0000Bi-Ai; Tue, 21 Oct 2025 05:07:36 -0400 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 1vB8L7-0008QE-Nw for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:33 -0400 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 1vB8L3-0004Tk-PG for qemu-devel@nongnu.org; Tue, 21 Oct 2025 05:07:33 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-303-eqtUKcY-M9qCk3TOwX6wSA-1; Tue, 21 Oct 2025 05:07:25 -0400 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1420D180A200; Tue, 21 Oct 2025 09:07:22 +0000 (UTC) Received: from localhost (unknown [10.44.22.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B04B8180057C; Tue, 21 Oct 2025 09:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761037648; 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=VW6PPOpSHOH3ehcMkX1Wx0+f+DPv/fFrft3dQrbw4og=; b=dNrciTnNSIXPlPPLRvIOVugt5GLmIl62kqAoa7wuMOPNbkunbBac2jmQf8GxSTX4F2KgAp 3DyMs/I3qPjK2dIUc1s2EXAYa4plYk7oYNSybjn4w6wvsagzhm/+8wY2pJ1c/Aoi7nXvLD 66CHoWwrivct54Kq0mxaYkVWnZ+ZP7o= X-MC-Unique: eqtUKcY-M9qCk3TOwX6wSA-1 X-Mimecast-MFC-AGG-ID: eqtUKcY-M9qCk3TOwX6wSA_1761037642 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Volker=20R=C3=BCmelin?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Christian Schoenebeck , Akihiko Odaki , Thomas Huth , Alexandre Ratchov Subject: [PATCH 43/43] audio: drop needless audio_driver "descr" field Date: Tue, 21 Oct 2025 13:03:14 +0400 Message-ID: <20251021090317.425409-44-marcandre.lureau@redhat.com> In-Reply-To: <20251021090317.425409-1-marcandre.lureau@redhat.com> References: <20251021090317.425409-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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761037732368154100 From: Marc-Andr=C3=A9 Lureau Was it ever used? Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki --- audio/audio_int.h | 1 - audio/alsaaudio.c | 1 - audio/dbusaudio.c | 1 - audio/dsoundaudio.c | 1 - audio/jackaudio.c | 1 - audio/noaudio.c | 1 - audio/ossaudio.c | 1 - audio/paaudio.c | 1 - audio/pwaudio.c | 1 - audio/sdlaudio.c | 1 - audio/sndioaudio.c | 1 - audio/spiceaudio.c | 1 - audio/wavaudio.c | 1 - audio/coreaudio.m | 1 - 14 files changed, 14 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 67da5ec6da..39caf8c1f6 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -144,7 +144,6 @@ struct SWVoiceIn { typedef struct audio_driver audio_driver; struct audio_driver { const char *name; - const char *descr; void *(*init) (Audiodev *, Error **); void (*fini) (void *); #ifdef CONFIG_GIO diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 46798069e6..3982ae787d 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -956,7 +956,6 @@ static struct audio_pcm_ops alsa_pcm_ops =3D { =20 static struct audio_driver alsa_audio_driver =3D { .name =3D "alsa", - .descr =3D "ALSA http://www.alsa-project.org", .init =3D alsa_audio_init, .fini =3D alsa_audio_fini, .pcm_ops =3D &alsa_pcm_ops, diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 972c0b9c7f..fbd55583c7 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -692,7 +692,6 @@ static struct audio_pcm_ops dbus_pcm_ops =3D { =20 static struct audio_driver dbus_audio_driver =3D { .name =3D "dbus", - .descr =3D "Timer based audio exposed with DBus interface", .init =3D dbus_audio_init, .fini =3D dbus_audio_fini, .set_dbus_server =3D dbus_audio_set_server, diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index fbb8890f5c..e75d235514 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -685,7 +685,6 @@ static struct audio_pcm_ops dsound_pcm_ops =3D { =20 static struct audio_driver dsound_audio_driver =3D { .name =3D "dsound", - .descr =3D "DirectSound http://wikipedia.org/wiki/DirectSound= ", .init =3D dsound_audio_init, .fini =3D dsound_audio_fini, .pcm_ops =3D &dsound_pcm_ops, diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 28face9989..7a3fcaedba 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -672,7 +672,6 @@ static struct audio_pcm_ops jack_pcm_ops =3D { =20 static struct audio_driver jack_driver =3D { .name =3D "jack", - .descr =3D "JACK Audio Connection Kit Client", .init =3D qjack_init, .fini =3D qjack_fini, .pcm_ops =3D &jack_pcm_ops, diff --git a/audio/noaudio.c b/audio/noaudio.c index b136b74e26..4ed9d2156c 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -129,7 +129,6 @@ static struct audio_pcm_ops no_pcm_ops =3D { =20 static struct audio_driver no_audio_driver =3D { .name =3D "none", - .descr =3D "Timer based audio emulation", .init =3D no_audio_init, .fini =3D no_audio_fini, .pcm_ops =3D &no_pcm_ops, diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 7ae28c99bc..3ab9fe8aeb 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -779,7 +779,6 @@ static struct audio_pcm_ops oss_pcm_ops =3D { =20 static struct audio_driver oss_audio_driver =3D { .name =3D "oss", - .descr =3D "OSS http://www.opensound.com", .init =3D oss_audio_init, .fini =3D oss_audio_fini, .pcm_ops =3D &oss_pcm_ops, diff --git a/audio/paaudio.c b/audio/paaudio.c index 8eb80ede45..6b9b6d219a 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -922,7 +922,6 @@ static struct audio_pcm_ops qpa_pcm_ops =3D { =20 static struct audio_driver pa_audio_driver =3D { .name =3D "pa", - .descr =3D "http://www.pulseaudio.org/", .init =3D qpa_audio_init, .fini =3D qpa_audio_fini, .pcm_ops =3D &qpa_pcm_ops, diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 8f6c0900c8..0fd59d9fe6 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -838,7 +838,6 @@ static struct audio_pcm_ops qpw_pcm_ops =3D { =20 static struct audio_driver pw_audio_driver =3D { .name =3D "pipewire", - .descr =3D "http://www.pipewire.org/", .init =3D qpw_audio_init, .fini =3D qpw_audio_fini, .pcm_ops =3D &qpw_pcm_ops, diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 4ef73c8dfb..a7a9652d29 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -490,7 +490,6 @@ static struct audio_pcm_ops sdl_pcm_ops =3D { =20 static struct audio_driver sdl_audio_driver =3D { .name =3D "sdl", - .descr =3D "SDL http://www.libsdl.org", .init =3D sdl_audio_init, .fini =3D sdl_audio_fini, .pcm_ops =3D &sdl_pcm_ops, diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c index f4f53b1c6f..8197b8b0b4 100644 --- a/audio/sndioaudio.c +++ b/audio/sndioaudio.c @@ -546,7 +546,6 @@ static struct audio_pcm_ops sndio_pcm_ops =3D { =20 static struct audio_driver sndio_audio_driver =3D { .name =3D "sndio", - .descr =3D "sndio https://sndio.org", .init =3D sndio_audio_init, .fini =3D sndio_audio_fini, .pcm_ops =3D &sndio_pcm_ops, diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 77ba89ffaa..7db2d1f0df 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -316,7 +316,6 @@ static struct audio_pcm_ops audio_callbacks =3D { =20 static struct audio_driver spice_audio_driver =3D { .name =3D "spice", - .descr =3D "spice audio driver", .init =3D spice_audio_init, .fini =3D spice_audio_fini, .pcm_ops =3D &audio_callbacks, diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 4d9c921305..46460a5d57 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -205,7 +205,6 @@ static struct audio_pcm_ops wav_pcm_ops =3D { =20 static struct audio_driver wav_audio_driver =3D { .name =3D "wav", - .descr =3D "WAV renderer http://wikipedia.org/wiki/WAV", .init =3D wav_audio_init, .fini =3D wav_audio_fini, .pcm_ops =3D &wav_pcm_ops, diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 8b3cd6db16..997017a1e9 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -664,7 +664,6 @@ static void coreaudio_audio_fini (void *opaque) =20 static struct audio_driver coreaudio_audio_driver =3D { .name =3D "coreaudio", - .descr =3D "CoreAudio http://developer.apple.com/audio/coreau= dio.html", .init =3D coreaudio_audio_init, .fini =3D coreaudio_audio_fini, .pcm_ops =3D &coreaudio_pcm_ops, --=20 2.51.0