From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878392; cv=none; d=zohomail.com; s=zohoarc; b=lJRSBmcpyF5C3a70iKoMHDXdR34yW/8pxOkQjMS7R569ZYpr/HBdZA3QjQyyYoO26hH3ftE5ftiK4dzk+W5sasX5iDnDQm5WIR//OE45qnLNyETbR0kj/7b/nuQPaskFyEWwoel263SUefpLl4mQNqMMaybDVLTwhVuMiy6mI3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878392; h=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=BPR2Ft+Be4GyY3W7td6w3kfNXO3EhQGNxOQakq3iWlw=; b=UJWWj9RBCtr8u0mOsGXqh/QkAOMnvU4ZdEYC4Vh0tpR1dsC6Z08af0JQiWgyBJcfORZwB+r9H5qbHsfXQ76TOQQExBg10O2p1gseyxSH3tSGCsQB9uMtYYVIb+mLCp1ReUNX7IhR+8nDTCSwGvpZTLf7H5vT1Wj45M4/tG0y8z4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878391969841.6362879408738; Mon, 23 Feb 2026 12:26:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV7-0003Xp-WA; Mon, 23 Feb 2026 15:25:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUp-0003AB-4T for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:39 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUi-0002O8-Qb for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:32 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 6A9E08E3E3; Mon, 23 Feb 2026 23:25:18 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-oG0UwHQT; Mon, 23 Feb 2026 23:25:17 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878317; bh=BPR2Ft+Be4GyY3W7td6w3kfNXO3EhQGNxOQakq3iWlw=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=kGtIGTnTGu5FTYdv9FYw4jPA64Zc+O7jWlf7IoToJuTUl7T72fqec21pCex4nGETl NVxgAgqSXmyHkU41xGDBYtfDtgC3Fl9CyMw+LpR3B4iQqYJnxlejoQT/cHGnEE9bYp oNAU1n4C0yCEYKyN8VKuNL0vomB8boNcKO4Tlk6I= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 01/10] audio: add `audio` build option for meson and Kconfig Date: Tue, 24 Feb 2026 01:25:03 +0500 Message-Id: <20260223202512.1308205-2-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=178.154.239.136; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878396242158500 Content-Type: text/plain; charset="utf-8" This patch adds the `audio` option to meson_options.txt. It is propagated into Kconfig as AUDIO. It is enabled by default. The corresponding `--disable-audio` and `--enable-audio` options for `configure` are also added. For now, this option does nothing. In subsequent patches, it will gradually disable audio in different places. The final goal is to stop building sources from `audio/` and `hw/audio/` and other audio-related files (except for some stubs). Note that this intent is different from `-audio none`, which mutes audio but still compiles the audio subsystem. Signed-off-by: Sergei Heifetz Reviewed-by: Marc-Andr=C3=A9 Lureau --- Kconfig.host | 3 +++ meson.build | 3 +++ meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 12 insertions(+) diff --git a/Kconfig.host b/Kconfig.host index 933425c74b..ec129aa4fc 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -29,6 +29,9 @@ config IVSHMEM config TPM bool =20 +config AUDIO + bool + config FDT bool =20 diff --git a/meson.build b/meson.build index 414c8ea7e2..fdb2578447 100644 --- a/meson.build +++ b/meson.build @@ -68,6 +68,8 @@ foreach target : target_dirs endforeach have_user =3D have_linux_user or have_bsd_user =20 +have_audio =3D get_option('audio').disable_auto_if(not have_system).allowe= d() + ############ # Programs # ############ @@ -3250,6 +3252,7 @@ disassemblers =3D { have_ivshmem =3D config_host_data.get('CONFIG_EVENTFD') host_kconfig =3D \ (get_option('fuzzing') ? ['CONFIG_FUZZ=3Dy'] : []) + \ + (have_audio ? ['CONFIG_AUDIO=3Dy'] : []) + \ (have_tpm ? ['CONFIG_TPM=3Dy'] : []) + \ (pixman.found() ? ['CONFIG_PIXMAN=3Dy'] : []) + \ (spice.found() ? ['CONFIG_SPICE=3Dy'] : []) + \ diff --git a/meson_options.txt b/meson_options.txt index 2836156257..d7c94e6d6d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -71,6 +71,9 @@ option('malloc_trim', type : 'feature', value : 'auto', option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemallo= c'], value: 'system', description: 'choose memory allocator to use') =20 +option('audio', type: 'feature', value: 'auto', + description: 'Audio support') + option('kvm', type: 'feature', value: 'auto', description: 'KVM acceleration support') option('mshv', type: 'feature', value: 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index e8edc5252a..642f06efc5 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -96,6 +96,7 @@ meson_options_help() { printf "%s\n" ' af-xdp AF_XDP network backend support' printf "%s\n" ' alsa ALSA sound support' printf "%s\n" ' attr attr/xattr support' + printf "%s\n" ' audio Audio support' printf "%s\n" ' auth-pam PAM access control' printf "%s\n" ' blkio libblkio block device driver' printf "%s\n" ' bochs bochs image format support' @@ -242,6 +243,8 @@ _meson_option_parse() { --disable-asan) printf "%s" -Dasan=3Dfalse ;; --enable-attr) printf "%s" -Dattr=3Denabled ;; --disable-attr) printf "%s" -Dattr=3Ddisabled ;; + --enable-audio) printf "%s" -Daudio=3Denabled ;; + --disable-audio) printf "%s" -Daudio=3Ddisabled ;; --audio-drv-list=3D*) quote_sh "-Daudio_drv_list=3D$2" ;; --enable-auth-pam) printf "%s" -Dauth_pam=3Denabled ;; --disable-auth-pam) printf "%s" -Dauth_pam=3Ddisabled ;; --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878413; cv=none; d=zohomail.com; s=zohoarc; b=mQka3MWa+q4Yv6OoUE5GyYXDtv/lZK8fv/JAmh8rQb/dcwLahmRRfXTipF63ZlvOHBsLnMF+Wy6fkyyPAWCnKhuiUjGIeskb8MpNhE72TAxpzAVmC91DD0TznZTx2Ov+uWOEkTsj1yVhoiHWoGi7YTpJNVRFTWwfG5bN+wQCiN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878413; h=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=SjfekYy1KKPRlbSpoX+il6/2VqVfL7BsAYE7hmgTVt0=; b=Ys9F1Xw0NGBlwox5KLvN7L/VlxT5YzH5e6m26RqA6/nrydaQzJByQ/3T/pnxHNYKXVzs0racES9Retz71IV7R/3ZptwNE61wL1r21/j2bsHb+kVPFfKZaAtAdQnDfW9vxBGSsQhwveFZkK46iI/IuSrkBs4ZbDyoPC7DUxny1AQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878413609729.666168352772; Mon, 23 Feb 2026 12:26:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV5-0003N6-Qa; Mon, 23 Feb 2026 15:25:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUl-000389-0h for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:34 -0500 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUh-0002OI-0g for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:30 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 8B03682F9D; Mon, 23 Feb 2026 23:25:20 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-acqcTRvo; Mon, 23 Feb 2026 23:25:19 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878320; bh=SjfekYy1KKPRlbSpoX+il6/2VqVfL7BsAYE7hmgTVt0=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=hqAGdY6Dr0dHszSTNiz9Q4w+HRw+fvRn22SxsbYVwFLai197O15997GyNsS++T750 W9OE/eBrkR44fDVtRbybFnsJ9aMtiyPHCOKyOFfA2Bl3wcH5RWD/1/71g0oWY/eRGR enVSE5pW9rx6maA4V8nXzPojLgxPNlMA4h48zo3o= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 02/10] ui/vnc: disable audio feature when configured with --disable-audio Date: Tue, 24 Feb 2026 01:25:04 +0500 Message-Id: <20260223202512.1308205-3-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878427576158500 Content-Type: text/plain; charset="utf-8" Disable the audio feature in VNC when QEMU is configured with `--disable-audio`. Do not compile the corresponding audio-related code. Signed-off-by: Sergei Heifetz --- ui/vnc.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index daf5b01d34..e6b6a9f4f9 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1072,6 +1072,7 @@ static void vnc_update_throttle_offset(VncState *vs) size_t offset =3D vs->client_width * vs->client_height * vs->client_pf.bytes_per_pix= el; =20 +#ifdef CONFIG_AUDIO if (vs->audio_cap) { int bps; switch (vs->as.fmt) { @@ -1091,6 +1092,7 @@ static void vnc_update_throttle_offset(VncState *vs) } offset +=3D vs->as.freq * bps * vs->as.nchannels; } +#endif =20 /* Put a floor of 1MB on offset, so that if we have a large pending * buffer and the display is resized to a small size & back again @@ -1214,6 +1216,7 @@ static int vnc_update_client(VncState *vs, int has_di= rty) return n; } =20 +#ifdef CONFIG_AUDIO /* audio */ static void audio_capture_notify(void *opaque, audcnotification_e cmd) { @@ -1293,6 +1296,7 @@ static void audio_del(VncState *vs) vs->audio_cap =3D NULL; } } +#endif =20 static void vnc_disconnect_start(VncState *vs) { @@ -1332,7 +1336,9 @@ void vnc_disconnect_finish(VncState *vs) #ifdef CONFIG_VNC_SASL vnc_sasl_client_cleanup(vs); #endif /* CONFIG_VNC_SASL */ +#ifdef CONFIG_AUDIO audio_del(vs); +#endif qkbd_state_lift_all_keys(vs->vd->kbd); =20 if (vs->mouse_mode_notifier.notify !=3D NULL) { @@ -2097,6 +2103,7 @@ static void send_ext_key_event_ack(VncState *vs) vnc_flush(vs); } =20 +#ifdef CONFIG_AUDIO static void send_ext_audio_ack(VncState *vs) { vnc_lock_output(vs); @@ -2110,6 +2117,7 @@ static void send_ext_audio_ack(VncState *vs) vnc_unlock_output(vs); vnc_flush(vs); } +#endif =20 static void send_xvp_message(VncState *vs, int code) { @@ -2197,10 +2205,15 @@ static void set_encodings(VncState *vs, int32_t *en= codings, size_t n_encodings) send_ext_key_event_ack(vs); break; case VNC_ENCODING_AUDIO: +#ifdef CONFIG_AUDIO if (vs->vd->audio_be) { vnc_set_feature(vs, VNC_FEATURE_AUDIO); send_ext_audio_ack(vs); } +#else + VNC_DEBUG("Audio encoding received with audio subsystem " + "disabled\n"); +#endif break; case VNC_ENCODING_WMVi: vnc_set_feature(vs, VNC_FEATURE_WMVI); @@ -2394,7 +2407,9 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) { int i; uint16_t limit; - uint32_t freq; + #ifdef CONFIG_AUDIO + uint32_t freq; + #endif VncDisplay *vd =3D vs->vd; =20 if (data[0] > 3) { @@ -2571,7 +2586,9 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) vnc_client_error(vs); break; } - +#ifndef CONFIG_AUDIO + abort(); +#else if (len =3D=3D 2) return 4; =20 @@ -2626,7 +2643,7 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) break; } break; - +#endif default: VNC_DEBUG("Msg: %d\n", read_u16(data, 0)); vnc_client_error(vs); @@ -3369,10 +3386,12 @@ static void vnc_connect(VncDisplay *vd, QIOChannelS= ocket *sioc, vs->last_x =3D -1; vs->last_y =3D -1; =20 +#ifdef CONFIG_AUDIO vs->as.freq =3D 44100; vs->as.nchannels =3D 2; vs->as.fmt =3D AUDIO_FORMAT_S16; vs->as.big_endian =3D false; +#endif =20 qemu_mutex_init(&vs->output_mutex); vs->bh =3D qemu_bh_new(vnc_jobs_bh, vs); @@ -3645,9 +3664,11 @@ static QemuOptsList qemu_vnc_opts =3D { },{ .name =3D "non-adaptive", .type =3D QEMU_OPT_BOOL, +#ifdef CONFIG_AUDIO },{ .name =3D "audiodev", .type =3D QEMU_OPT_STRING, +#endif },{ .name =3D "power-control", .type =3D QEMU_OPT_BOOL, @@ -4080,7 +4101,9 @@ void vnc_display_open(const char *id, Error **errp) const char *saslauthz; int lock_key_sync =3D 1; int key_delay_ms; +#ifdef CONFIG_AUDIO const char *audiodev; +#endif const char *passwordSecret; =20 if (!vd) { @@ -4238,6 +4261,7 @@ void vnc_display_open(const char *id, Error **errp) } vd->ledstate =3D 0; =20 +#ifdef CONFIG_AUDIO audiodev =3D qemu_opt_get(opts, "audiodev"); if (audiodev) { vd->audio_be =3D audio_be_by_name(audiodev, errp); @@ -4247,6 +4271,7 @@ void vnc_display_open(const char *id, Error **errp) } else { vd->audio_be =3D audio_get_default_audio_be(NULL); } +#endif =20 device_id =3D qemu_opt_get(opts, "display"); if (device_id) { --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878393; cv=none; d=zohomail.com; s=zohoarc; b=BruYab2l0dbqcI0viUaPbglFbO3kh+FZ/JzP2OrpEE8QtOGv5vCM26RckKgZdL0IbnbKrGJ6Y+KnawNtsPaUipLhS4Un1Vz4B+oS7r1SpfTasMl//FirgC1jt0x+4OtUnVBP8dt54ck1zh6vAfmO0QHsYup6GoPc35abktQWQZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878393; h=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=Twr+z928RNRk3tIeQZXM6lSxyRrQ0XzjOsjA3Sc+TL4=; b=LRTQpnM9Z0rbFL+wQN8RGlI33krqbh0NlIGB87SR8/x7O61G527DcIpE9Rkwc15NjD3kvE7ivFzIX3HcJ0R5snp6956Eu7szgIvQPIhmq/7MnNffw1wdVj3bNN5fIWsLqci1gwtovTrgnAAbwl8Uk8CciV6G5bKC8lgVf30Cb2c= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878393231431.13392528113866; Mon, 23 Feb 2026 12:26:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV5-0003NA-Vb; Mon, 23 Feb 2026 15:25:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUp-0003A8-3r for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:38 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUk-0002OS-NA for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:32 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 176AA8E412; Mon, 23 Feb 2026 23:25:22 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-IWzb5GJf; Mon, 23 Feb 2026 23:25:21 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878321; bh=Twr+z928RNRk3tIeQZXM6lSxyRrQ0XzjOsjA3Sc+TL4=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=11IpAOGtY/x38QVEW9++aMFJoVZyLvYNRNuRxv0Wr4M33f8kZpYIHwJvRyne7o8pp hS2v9dFO4ltVAFzBADR3jgRay9M9wyEU5d+QLdjAWhwmGLkJ3GEEjylArkrdmJIK1H k/ESVzpp+fGWBmtJpF/4+7xXiWR61ZY5z+yCuRhM= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 03/10] tests/qtest: remove -audio none when configured with --disable-audio Date: Tue, 24 Feb 2026 01:25:05 +0500 Message-Id: <20260223202512.1308205-4-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=178.154.239.136; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878396295158500 Content-Type: text/plain; charset="utf-8" It does not matter much whether `-audio none` is passed. In the future, support for `-audio none` with `--disable-audio` will be dropped, so we should remove it beforehand. Signed-off-by: Sergei Heifetz Reviewed-by: Thomas Huth Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/libqtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 794d870085..adb968f40e 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -464,7 +464,9 @@ gchar *qtest_qemu_args(const char *extra_args) "-chardev socket,path=3D%s,id=3Dchar0 " "-mon chardev=3Dchar0,mode=3Dcontrol " "-display none " +#ifdef CONFIG_AUDIO "-audio none " +#endif "%s" "%s" " -accel qtest", --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878393; cv=none; d=zohomail.com; s=zohoarc; b=NLVo7CQwJNY6TFvR+fPAay2nl/yA1pWDZKm55I4a5AFRR+TuCEdk8VOKP4/3Lz04imX0xe/EcWQCGsCzZYd3dpdEENExE+V/lMWTzXZZTw7GPfeEJf0TFJXtK3mnEqhmehZ0V5YCN2l7P7OXDzhG/FpMdH+252CVBh6PFOhmG+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878393; h=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=Yq0CWubq2cVL00aDsB6wDvjl/NGJ8QzW3ZUX45lNfyg=; b=bxWuehUxedrVOFNzdMJdHvPaMIzkmdTMwEwUgJrbTIDbYyEtBhulWvl5cHpMGxtKYBqpVho5H3oGs8yy1mLvUlAfKYFcSU3x7YzdExUteJqJAgefo+P1ygRwW/Tku5jAB7SFKQ9nrxqwFCExsncA3sPxyn9tyttjhpb8P1OcOL0= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878392972645.202889362038; Mon, 23 Feb 2026 12:26:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV9-0003Zm-PL; Mon, 23 Feb 2026 15:25:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUp-0003A6-3Z for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:37 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUi-0002Or-Qj for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:32 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 2918B8E413; Mon, 23 Feb 2026 23:25:24 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-rY4DI9og; Mon, 23 Feb 2026 23:25:23 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878323; bh=Yq0CWubq2cVL00aDsB6wDvjl/NGJ8QzW3ZUX45lNfyg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=lXJxtGdHcQuI9mHVb6hc1whmnGTlx8g1IBAHkB+6ZKItvYNLC8/HrdOnXLIt6zL2V xNdGGBqp8UqTkPrWyhJSxi7lB7dB3X4wzAizfEj0bXrAuJXPxTd3rgUk/u/T/t86mJ 3WbpgSDtONUUmQsZg2OUneN+5IdkIgEISjS83WbY= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 04/10] hw/audio/pcspk: change PCSPK behaviour with --disable-audio Date: Tue, 24 Feb 2026 01:25:06 +0500 Message-Id: <20260223202512.1308205-5-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=178.154.239.136; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878396231158500 Content-Type: text/plain; charset="utf-8" PCSPK (PC Speaker) is an embedded audio device. We don't want it to use aud= io when QEMU is configured with `--disable-audio`. This is achieved with minim= al, non-invasive changes to the code. In essence, the changes ensure that PCSPK does not have a corresponding audio backend, while functioning the same way in non-audio aspects. Signed-off-by: Sergei Heifetz Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/audio/pcspk.c | 12 +++++++++++- hw/i386/pc.c | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 6b826507ce..54e1882265 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -48,17 +48,20 @@ struct PCSpkState { =20 MemoryRegion ioport; uint32_t iobase; + PITCommonState *pit; +#ifdef CONFIG_AUDIO uint8_t sample_buf[PCSPK_BUF_LEN]; AudioBackend *audio_be; SWVoiceOut *voice; - PITCommonState *pit; unsigned int pit_count; unsigned int samples; unsigned int play_pos; +#endif uint8_t data_on; uint8_t dummy_refresh_clock; }; =20 +#ifdef CONFIG_AUDIO static const char *s_spk =3D "pcspk"; =20 static inline void generate_samples(PCSpkState *s) @@ -130,6 +133,7 @@ static int pcspk_audio_init(PCSpkState *s) =20 return 0; } +#endif =20 static uint64_t pcspk_io_read(void *opaque, hwaddr addr, unsigned size) @@ -160,11 +164,13 @@ static void pcspk_io_write(void *opaque, hwaddr addr,= uint64_t val, =20 s->data_on =3D (val >> 1) & 1; pit_set_gate(s->pit, 2, gate); +#ifdef CONFIG_AUDIO if (s->voice) { if (gate) /* restart */ s->play_pos =3D 0; audio_be_set_active_out(s->audio_be, s->voice, gate & s->data_on); } +#endif } =20 static const MemoryRegionOps pcspk_io_ops =3D { @@ -195,10 +201,12 @@ static void pcspk_realizefn(DeviceState *dev, Error *= *errp) =20 isa_register_ioport(isadev, &s->ioport, s->iobase); =20 +#ifdef CONFIG_AUDIO if (s->audio_be && audio_be_check(&s->audio_be, errp)) { pcspk_audio_init(s); return; } +#endif } =20 static const VMStateDescription vmstate_spk =3D { @@ -213,7 +221,9 @@ static const VMStateDescription vmstate_spk =3D { }; =20 static const Property pcspk_properties[] =3D { +#ifdef CONFIG_AUDIO DEFINE_AUDIO_PROPERTIES(PCSpkState, audio_be), +#endif DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, 0x61), DEFINE_PROP_LINK("pit", PCSpkState, pit, TYPE_PIT_COMMON, PITCommonSta= te *), }; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0dd3fd01d9..3992553c2a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1679,8 +1679,10 @@ static void pc_machine_initfn(Object *obj) =20 pc_system_flash_create(pcms); pcms->pcspk =3D isa_new(TYPE_PC_SPEAKER); +#ifdef CONFIG_AUDIO object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); +#endif if (pcmc->pci_enabled) { cxl_machine_init(obj, &pcms->cxl_devices_state); } --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878432; cv=none; d=zohomail.com; s=zohoarc; b=eHi+3/0ajXoEA85eDfgUhLbqdYNx4RnP3ixWUlaX5kqcVJwOUpOnKc09O8HfWSkj4hwfHIwDdwP/dfepAw3jhggl5uS4nSFwc78LrA6CzRL16tcFy00xEod+fWpbvYEqTL6IvDBWiLuwH+o8W8GHQlL7k9VV1lr+vpy6+57dPxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878432; h=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=hFepRe+ZWTO6AfdmQf/4gqWn3XAxk0Itxucc46LfZKU=; b=DAhFTZQcRZKXhmganR3/OwGkZsO8sRA3//p7IUT4uPVGmQSLcwG6iQRZwRnCmWQKzxuC/5KLBQ5dhSrK8T+BtqeXLH8lL6D1nijJRxziF0sCEn+St9Dju01WRcDFpd6VFPA1qYnd5ca0UQFwl3LbLnAYqLB6wgJc8iOWlkFSXiM= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878432196739.560628835131; Mon, 23 Feb 2026 12:27:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucVA-0003fP-Sp; Mon, 23 Feb 2026 15:25:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUp-0003AA-4J for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:38 -0500 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUk-0002Oy-NN for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:32 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id E5A1182F9E; Mon, 23 Feb 2026 23:25:25 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-7a4poIKP; Mon, 23 Feb 2026 23:25:25 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878325; bh=hFepRe+ZWTO6AfdmQf/4gqWn3XAxk0Itxucc46LfZKU=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=ZMUM1y1lqVf15JUFz13MElB5pOmqMCQicjC+8cZF44Q7T9Saao+hPk+/ggTcobL77 Yz2t5hNL+K1TiITmGq6mS7/QFoyaoS0uneRRaC95Tmfr/4e+D9jD2oGakpTxfB1zm3 xyurZ80oQvIElr/eJtti5HVNkKLPYi9yNEXOi2WM= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 05/10] Kconfig: add AUDIO dependency to audio-related devices Date: Tue, 24 Feb 2026 01:25:07 +0500 Message-Id: <20260223202512.1308205-6-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=178.154.239.200; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878432909158500 Content-Type: text/plain; charset="utf-8" The idea of the `--disable-audio` option is to stop building audio-related source files. Although this is not yet implemented, we can already make the existing AUDIO Kconfig option a dependency for a number of devices so that the build does not break when we remove `audio/` and other sources. Note that some machines have embedded audio devices and therefore cannot be used with `--disable-audio` at all. `-audio none` should be used for such machines if audio needs to be muted. The only device that is purposefully not included in this patch is PCSPK (PC speaker), because its code has already been modified to work with `--disable-audio`. Signed-off-by: Sergei Heifetz Reviewed-by: Thomas Huth Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/audio/Kconfig | 21 ++++++++++++--------- hw/usb/Kconfig | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig index daf060e1be..0479818e3f 100644 --- a/hw/audio/Kconfig +++ b/hw/audio/Kconfig @@ -1,37 +1,37 @@ config SB16 bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config ES1370 bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config AC97 bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config ADLIB bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config GUS bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config CS4231A bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config HDA bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config PCSPK bool @@ -40,18 +40,21 @@ config PCSPK =20 config WM8750 bool - depends on I2C + depends on I2C && AUDIO =20 config PL041 bool + depends on AUDIO =20 config CS4231 bool + depends on AUDIO =20 config ASC bool + depends on AUDIO =20 config VIRTIO_SND bool default y - depends on VIRTIO + depends on VIRTIO && AUDIO diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig index de95686720..e370585892 100644 --- a/hw/usb/Kconfig +++ b/hw/usb/Kconfig @@ -98,7 +98,7 @@ config USB_STORAGE_UAS config USB_AUDIO bool default y - depends on USB + depends on USB && AUDIO =20 config USB_SERIAL bool --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878417; cv=none; d=zohomail.com; s=zohoarc; b=hc9bGpSZ+nTHP4fmYcsyiSfGQDk5ysFOeX9CLHsZ5KdlCeOHhs18gUkLWIwa89SNSxWuknyAwbJl7oZFSDADiTmUO6Ti/oYm/MOjhXx/By1zT1iIMi/OT8bTyumpjShNUWOv5wo58NLV4SoOuMK9OeaAzXuH6rDGeDQCTymiIFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878417; h=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=9ceJPNF+GibX+1lEopP1Na2t0yPChyucOxlsimiIu5s=; b=LOviuxU8b+hRq2KtjHfOQ3kCurHIvb9fXtlmAswTLbPGdH5JGxIY6GNJI5q9uYpwO6KQebpF6l1Sp6/6Nze9ejVdficqwlBiRWLpxMYDnGdVlakNZMYgyv6ijLTFFOqAH4QsL0O5y0JP9fQaC+iAh7sLQoVEG1ILOzoX4R6TUfQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878417970122.16513928191728; Mon, 23 Feb 2026 12:26:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV7-0003Tu-6p; Mon, 23 Feb 2026 15:25:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUp-0003A7-3f for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:37 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUk-0002PB-NM for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:32 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 9E9A98E415; Mon, 23 Feb 2026 23:25:27 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-EWLOsRXS; Mon, 23 Feb 2026 23:25:27 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878327; bh=9ceJPNF+GibX+1lEopP1Na2t0yPChyucOxlsimiIu5s=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=jQytX73/oQ+PfgV9hyiPOrekaUXQpZmBYml9wpoTagxTmp6j50oDupdJrr55CmyqP vJBevK475SHWdbKumJnU5aYghce7l5wspqBTh2cbNMEDbUx4NSNpXYhrbYnKifGJaQ /BU7yNLdKZvHpIDtr30ZK7neLvnLUY4msxRsTsZs= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 06/10] system/vl: remove audio and audiodev options when audio is disabled Date: Tue, 24 Feb 2026 01:25:08 +0500 Message-Id: <20260223202512.1308205-7-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878418925158500 Content-Type: text/plain; charset="utf-8" Remove the audio and audiodev runtime options when QEMU is configured with `--disable-audio`. Signed-off-by: Sergei Heifetz --- system/vl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/vl.c b/system/vl.c index 3e341142a0..1034a4688f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2248,7 +2248,9 @@ static int global_init_func(void *opaque, QemuOpts *o= pts, Error **errp) static bool is_qemuopts_group(const char *group) { if (g_str_equal(group, "object") || +#ifdef CONFIG_AUDIO g_str_equal(group, "audiodev") || +#endif g_str_equal(group, "machine") || g_str_equal(group, "smp-opts") || g_str_equal(group, "boot-opts")) { @@ -2265,6 +2267,7 @@ static void qemu_record_config_group(const char *grou= p, QDict *dict, object_option_add_visitor(v); visit_free(v); =20 +#ifdef CONFIG_AUDIO } else if (g_str_equal(group, "audiodev")) { Audiodev *dev =3D NULL; Visitor *v =3D qobject_input_visitor_new_keyval(QOBJECT(dict)); @@ -2272,6 +2275,7 @@ static void qemu_record_config_group(const char *grou= p, QDict *dict, audio_add_audiodev(dev); } visit_free(v); +#endif =20 } else if (g_str_equal(group, "machine")) { /* @@ -3057,6 +3061,7 @@ void qemu_init(int argc, char **argv) } break; #endif +#ifdef CONFIG_AUDIO case QEMU_OPTION_audiodev: default_audio =3D 0; audio_parse_option(optarg); @@ -3097,6 +3102,7 @@ void qemu_init(int argc, char **argv) } break; } +#endif case QEMU_OPTION_h: help(0); break; --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878395; cv=none; d=zohomail.com; s=zohoarc; b=cPC7pwNbGM8tqzydaqSWt221XfVeTFcv+hdnb41gMUjCX36EtHZZyCikPkVKxQqufxbh3Ur4nvmdvM4wIlOcLnMDpT4KAJx1syA3iODE7QyzuY/l2g0NZT9G66Gd84Hs2r0kbxRn5RBpt8D8tsezQJhOVZVUuxjlovDeNiQT7iI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878395; 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=PQPQQtSOdQM/eYOSPBmu9Qf2kOq+nWzcuYFqYen53g8=; b=ZTrfCNbIvbOw/H56GhW0kB6EpqTaEsjGqKyFm0PAXE83ikP+NQqLbmcoiowWpmeg3j6M3tamC4+q7CFaNY4PEM3EGlM8wpeE3v5vAB2t9f6PZFwsJ7IZo37v6pjX66dBDnusGxcIJZS9R8CYFWwogT5By9+eVNvLrTcbfqxzCeY= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878395184777.6342971844089; Mon, 23 Feb 2026 12:26:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucVE-0003gr-9L; Mon, 23 Feb 2026 15:26:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucV0-0003Fr-BP for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:47 -0500 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUo-0002PQ-NY for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:37 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id D2D5982FA1; Mon, 23 Feb 2026 23:25:29 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-DHM2AuKJ; Mon, 23 Feb 2026 23:25:29 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878329; bh=PQPQQtSOdQM/eYOSPBmu9Qf2kOq+nWzcuYFqYen53g8=; h=Cc:Message-Id:References:Date:In-Reply-To:Subject:To:From; b=0QhpT4sHWRzvsbEpRGGzbPmQ7YN/iC69orWprs94fwvm/jKPGmidEPliVqNMZhX3m KRrQtpBImZ0HXHPRNnopBJcDsfbWEXysGdbT6Jg94/Wyclwr7sFOJl8BrqDG3N/NSP 88riqdvaEh/dU94jH26C6KmLODC9m859FoQ1qz6U= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 07/10] ui/dbus: run without Audio interface when audio is disabled Date: Tue, 24 Feb 2026 01:25:09 +0500 Message-Id: <20260223202512.1308205-8-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=178.154.239.200; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878396903158500 D-Bus display can be used even when QEMU is configured with `--disable-audio`. In that case, audio interface will not be available on `/org/qemu/Display1/Audio`. (The current handling of the situation when audio is enabled but no D-Bus-compatible audio backend is available is different and hasn=E2=80=99t been changed.) Signed-off-by: Sergei Heifetz --- ui/dbus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/dbus.c b/ui/dbus.c index 905ee6fea7..60c8e0b473 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -219,6 +219,7 @@ dbus_display_complete(UserCreatable *uc, Error **errp) return; } =20 +#ifdef CONFIG_AUDIO { AudioBackend *audio_be =3D audio_get_default_audio_be(NULL); if (audio_be && !audio_be_can_set_dbus_server(audio_be)) { @@ -234,6 +235,7 @@ dbus_display_complete(UserCreatable *uc, Error **errp) return; } } +#endif =20 consoles =3D g_array_new(FALSE, FALSE, sizeof(guint32)); for (idx =3D 0;; idx++) { --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878407; cv=none; d=zohomail.com; s=zohoarc; b=gHJAMnO/hdrGpLH6mpOG9fTnhhiw89/GuNDO458h5yqpvNkLPurZqqjJ9Fwn/Jh4betAhlRPPApZv8I6IdJwUcsAOlr/XyomQEbEwItwQ/bJgFK/ZXxiVq9iVRAyO+fncEEJyxBDeMvkfQtpttfFRPvBqN+JIA+kuSp2pBme3Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878407; h=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=SY9SI0+hHzwtfYx1/Wd2p5suPOjicjvA4XSoWxL+b5I=; b=BB6CNgx86eTnRq83w+Z1t9FnhB4yKpOWQEkpcEnU1NpGo3CTjk1FMp3MFECMk/zrJxEi8hDgEGWudjr86AmK2hbNBtMmQPQAruDt8h6gNhAqOSfeKkCHkbUbMW70Z+UF9S3QePL8/9rrUiw0a3ohkM2lVvMpreJEDcPuFePvqss= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878407449886.9706299192768; Mon, 23 Feb 2026 12:26:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucV9-0003ah-2E; Mon, 23 Feb 2026 15:25:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucV0-0003Fq-BT for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:47 -0500 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUo-0002Ps-OV for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:38 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id CD3DB82FA0; Mon, 23 Feb 2026 23:25:31 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-EoWOqJjY; Mon, 23 Feb 2026 23:25:31 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878331; bh=SY9SI0+hHzwtfYx1/Wd2p5suPOjicjvA4XSoWxL+b5I=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=APFwPdmYa6CmPdraFz+7bNmmJtksy8sEQkJL9fZonjreiNII4KsSbLAYA80/1Oetb oBdXZ2rPD1vlrmnmUmbXmXNGteTMmUOZmHQ6lfyZJwKUxAySojvoGny5/tp7xNRy5Y ESAaQF52m9fhyn6yezRLxq/FvVHdKUhVqOFIlT/E= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 08/10] tests/audio: do not compile if audio is disabled Date: Tue, 24 Feb 2026 01:25:10 +0500 Message-Id: <20260223202512.1308205-9-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878408576158500 Content-Type: text/plain; charset="utf-8" If QEMU is configured with --disable-audio, do not compile the audio tests. Signed-off-by: Sergei Heifetz Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/audio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/audio/meson.build b/tests/audio/meson.build index 84754bde22..97c1d623bb 100644 --- a/tests/audio/meson.build +++ b/tests/audio/meson.build @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 -if not have_system +if not have_audio subdir_done() endif =20 --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878402; cv=none; d=zohomail.com; s=zohoarc; b=dZk1yYk4CvzknHP/GRUro5JkEGVWTPoFt+JuKl7CH4NAImdaiq3HHwdG0Sk7S8oe5eZxJKv+GgA95IZEsA9+VYYjDlBDoDAkCrxlQKxhKO6F79Pe05I11fEKMsH5QksANIuIcnDxynHzHNgsIhlV62qbh4YTdWTFMBsnn2khUlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878402; h=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=HUFhgKVNj/LZH5vB4eAuPYv3xept63cXyT7ucevHwAg=; b=e6iV5Rooi9JXMcFosqqPRVaylEYSI/DECb35YjfXl/cm6k/AmNAMDNC0E1yjlFJgecAcvGzdqVJKei0GBRcV9MkCNBPjiMs0hB2HTLbFylhUQLQfXHRVsev5T5Yp1OQ3y4LCT3Az9xIytPoqkSKdhGsaWer4BTTbJOaKENq+ax4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878402586282.21758461988986; Mon, 23 Feb 2026 12:26:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucVB-0003fd-3a; Mon, 23 Feb 2026 15:25:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucV0-0003Fz-Ut for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:47 -0500 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUq-0002Q5-FH for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:41 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id E079982FAE; Mon, 23 Feb 2026 23:25:33 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-iKaPnRDF; Mon, 23 Feb 2026 23:25:33 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878333; bh=HUFhgKVNj/LZH5vB4eAuPYv3xept63cXyT7ucevHwAg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=0t0ZBXH4W/jCZ6G2A+P7koli0PUsLHu7uDBqL4LnwF2askcCq+7p2W/BcszVAois7 OyxtnJ0tQZ3m8flTdFAzG2ZAQXB945nK7br/9fiXix9LNrbfVL0neI/fAeHBzSzTCH bz99vtAFzEYCPNlSU6W/+V6K7MSY0Cp9gW/Hny1o= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 09/10] audio: do not build audio-related sources with --disable-audio Date: Tue, 24 Feb 2026 01:25:11 +0500 Message-Id: <20260223202512.1308205-10-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878405362158500 Content-Type: text/plain; charset="utf-8" When QEMU is configured with `--disable-audio`, do not build any audio-related sources. - audio/meson.build and replay/meson.build: Exclude audio-related sources when audio is disabled. - audio/audio-stub.c: Provide a minimal set of straightforward stubs. - replay/replay-audio-stub.c: Move the existing stubs from replay/stubs-system.c into a separate file. - qapi/audio.json: Remove the QMP `query-audiodevs` command. - hmp-commands*.hx: Remove the HMP `info capture`, `stopcapture` and `wavcapture` commands. Signed-off-by: Sergei Heifetz --- audio/audio-stub.c | 22 ++++++++++++++++++++++ audio/meson.build | 5 +++++ hmp-commands-info.hx | 2 ++ hmp-commands.hx | 2 ++ hw/core/qdev-properties-system.c | 2 ++ qapi/audio.json | 3 ++- replay/meson.build | 9 ++++++++- replay/replay-audio-stub.c | 21 +++++++++++++++++++++ replay/stubs-system.c | 12 ------------ 9 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 audio/audio-stub.c create mode 100644 replay/replay-audio-stub.c diff --git a/audio/audio-stub.c b/audio/audio-stub.c new file mode 100644 index 0000000000..f58f88cd83 --- /dev/null +++ b/audio/audio-stub.c @@ -0,0 +1,22 @@ +/* + * Stub for audio.c + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-commands-audio.h" +#include "qemu/audio.h" +#include "qapi/error.h" + +void audio_cleanup(void) {} + +AudioBackend *audio_be_by_name(const char *name, Error **errp) +{ + error_setg(errp, "audio disabled"); + return NULL; +} + +void audio_init_audiodevs(void) {} + +void audio_create_default_audiodevs(void) {} diff --git a/audio/meson.build b/audio/meson.build index 0e33b6f983..19d43dc315 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -1,4 +1,9 @@ audio_ss =3D ss.source_set() +if not have_audio + audio_ss.add(files('audio-stub.c')) + subdir_done() +endif + audio_ss.add(files( 'audio.c', 'audio-be.c', diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 74c741f80e..a959479024 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -364,6 +364,7 @@ SRST ERST =20 /* BEGIN deprecated */ +#ifdef CONFIG_AUDIO { .name =3D "capture", .args_type =3D "", @@ -376,6 +377,7 @@ SRST ``info capture`` Show capture information (deprecated). ERST +#endif /* END deprecated */ =20 { diff --git a/hmp-commands.hx b/hmp-commands.hx index 5cc4788f12..e8b8175bb9 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -765,6 +765,7 @@ SRST ERST =20 /* BEGIN deprecated */ +#ifdef CONFIG_AUDIO { .name =3D "wavcapture", .args_type =3D "path:F,audiodev:s,freq:i?,bits:i?,nchannels:i?", @@ -802,6 +803,7 @@ SRST =20 Deprecated. ERST +#endif /* END deprecated */ =20 { diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index a402321f42..8679a71b53 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -483,6 +483,7 @@ const PropertyInfo qdev_prop_netdev =3D { }; =20 =20 +#ifdef CONFIG_AUDIO /* --- audiodev --- */ static void get_audiodev(Object *obj, Visitor *v, const char* name, void *opaque, Error **errp) @@ -519,6 +520,7 @@ const PropertyInfo qdev_prop_audiodev =3D { .get =3D get_audiodev, .set =3D set_audiodev, }; +#endif =20 bool qdev_prop_set_drive_err(DeviceState *dev, const char *name, BlockBackend *value, Error **errp) diff --git a/qapi/audio.json b/qapi/audio.json index 2df87b9710..28fda7c8ac 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -540,4 +540,5 @@ # Since: 8.0 ## { 'command': 'query-audiodevs', - 'returns': ['Audiodev'] } + 'returns': ['Audiodev'], + 'if': 'CONFIG_AUDIO' } diff --git a/replay/meson.build b/replay/meson.build index 4b4175e8dd..dc2e94e897 100644 --- a/replay/meson.build +++ b/replay/meson.build @@ -7,7 +7,14 @@ system_ss.add(when: 'CONFIG_TCG', if_true: files( 'replay-char.c', 'replay-snapshot.c', 'replay-net.c', - 'replay-audio.c', 'replay-random.c', 'replay-debugging.c', ), if_false: files('stubs-system.c')) + +if have_audio + system_ss.add(when: 'CONFIG_TCG', + if_true: files('replay-audio.c'), + if_false: files('replay-audio-stub.c')) +else + system_ss.add(files('replay-audio-stub.c')) +endif diff --git a/replay/replay-audio-stub.c b/replay/replay-audio-stub.c new file mode 100644 index 0000000000..b3da8e1558 --- /dev/null +++ b/replay/replay-audio-stub.c @@ -0,0 +1,21 @@ +/* + * Stub for replay-audio.c + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/replay.h" + +void replay_audio_in_start(size_t *nsamples) +{ +} +void replay_audio_in_sample_lr(uint64_t *left, uint64_t *right) +{ +} +void replay_audio_in_finish(void) +{ +} +void replay_audio_out(size_t *played) +{ +} diff --git a/replay/stubs-system.c b/replay/stubs-system.c index b2c52bc404..454415ae8e 100644 --- a/replay/stubs-system.c +++ b/replay/stubs-system.c @@ -15,18 +15,6 @@ void replay_input_sync_event(void) void replay_add_blocker(const char *feature) { } -void replay_audio_in_start(size_t *nsamples) -{ -} -void replay_audio_in_sample_lr(uint64_t *left, uint64_t *right) -{ -} -void replay_audio_in_finish(void) -{ -} -void replay_audio_out(size_t *played) -{ -} void replay_breakpoint(void) { } --=20 2.34.1 From nobody Sun Apr 12 00:57:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771878403; cv=none; d=zohomail.com; s=zohoarc; b=Wu+ADgJMamTD8Y37NzNMfCI13yKq9hGNEXMh1HCZsurnZSq/6QmTaj+z5pryeAQm6JWuGvYhknjcwIpkjUb0w2Q36AZKLIBi6eInJQEj0ifsT3UFn+4EIhvnX592JmVfLbLK1ZCHhQbeeY+cy5SFNtxijOpaChBrLP+tBFqAf3k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771878403; h=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=79h67q6LX1lQ96c0uP4Rm18o9dNvSF7B8/1ghQcCkZY=; b=GE13xns0tupxSdj3y/Z42iREZG4AVWqGQlNqZj/N/OUuv7E6HpcfWTRoe4EGeMv5lUwPPGJrYU75lQvNxUKTe/eYLQ8+kGH/KJRPH5vnUeuC01z7m1XGAYSnrI8gonDmfG+9m5BHwKepi9ck/ApFBBy5vM4vcvE59rUZLgpP+zY= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771878403073104.55665121285938; Mon, 23 Feb 2026 12:26:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vucVE-0003gs-Ag; Mon, 23 Feb 2026 15:26:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucV1-0003GF-Ty for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:48 -0500 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vucUv-0002R9-Mr for qemu-devel@nongnu.org; Mon, 23 Feb 2026 15:25:47 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id E581982FC0; Mon, 23 Feb 2026 23:25:36 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:12d::1:2c]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CPmvPN6Ap8c0-KKDYrATx; Mon, 23 Feb 2026 23:25:36 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771878336; bh=79h67q6LX1lQ96c0uP4Rm18o9dNvSF7B8/1ghQcCkZY=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=uPtu32VNDHcPg1HQXyFbwffZEB2Nk2D4e7xQtdurF6hN06CiN0uV48Pc8b1ur4xie IgduYQ8DfG/WSW/syBV0Y+c9GBIawcWddKt88HcpQ2H4YFBiSOnafwiRWxrHITraCR JU2/2norgVhv3Rci8NuhCCvAlSL95+enFsKwH1YE= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Fabiano Rosas , Laurent Vivier , Thomas Huth , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , "Michael S. Tsirkin" , Markus Armbruster , "Dr. David Alan Gilbert" Subject: [PATCH v2 10/10] meson.build: ignore audio drivers when configured with --disable-audio Date: Tue, 24 Feb 2026 01:25:12 +0500 Message-Id: <20260223202512.1308205-11-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260223202512.1308205-1-heifetz@yandex-team.com> References: <20260223202512.1308205-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1d.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771878405334158500 Content-Type: text/plain; charset="utf-8" When QEMU is configured with `--disable-audio`, we do not need to add the audio drivers list to config_host_data. We also do not need to print this list. Signed-off-by: Sergei Heifetz Reviewed-by: Marc-Andr=C3=A9 Lureau --- meson.build | 80 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/meson.build b/meson.build index fdb2578447..ae71a0dd91 100644 --- a/meson.build +++ b/meson.build @@ -2272,46 +2272,55 @@ endif config_host_data =3D configuration_data() =20 config_host_data.set('CONFIG_HAVE_RUST', have_rust) -audio_drivers_selected =3D [] -if have_system - audio_drivers_available =3D { - 'alsa': alsa.found(), - 'coreaudio': coreaudio.found(), - 'dsound': dsound.found(), - 'jack': jack.found(), - 'oss': oss.found(), - 'pa': pulse.found(), - 'pipewire': pipewire.found(), - 'sdl': sdl.found(), - 'sndio': sndio.found(), - } - foreach k, v: audio_drivers_available - config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) - endforeach +config_host_data.set('CONFIG_AUDIO', have_audio) +if have_audio + audio_drivers_selected =3D [] + if have_system + audio_drivers_available =3D { + 'alsa': alsa.found(), + 'coreaudio': coreaudio.found(), + 'dsound': dsound.found(), + 'jack': jack.found(), + 'oss': oss.found(), + 'pa': pulse.found(), + 'pipewire': pipewire.found(), + 'sdl': sdl.found(), + 'sndio': sndio.found(), + } + foreach k, v: audio_drivers_available + config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) + endforeach =20 - # Default to native drivers first, OSS second, SDL third - audio_drivers_priority =3D \ - [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \ - (host_os =3D=3D 'linux' ? [] : [ 'sdl' ]) - audio_drivers_default =3D [] - foreach k: audio_drivers_priority - if audio_drivers_available[k] - audio_drivers_default +=3D k - endif - endforeach + # Default to native drivers first, OSS second, SDL third + audio_drivers_priority =3D \ + [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \ + (host_os =3D=3D 'linux' ? [] : [ 'sdl' ]) + audio_drivers_default =3D [] + foreach k: audio_drivers_priority + if audio_drivers_available[k] + audio_drivers_default +=3D k + endif + endforeach =20 + foreach k: get_option('audio_drv_list') + if k =3D=3D 'default' + audio_drivers_selected +=3D audio_drivers_default + elif not audio_drivers_available[k] + error('Audio driver "@0@" not available.'.format(k)) + else + audio_drivers_selected +=3D k + endif + endforeach + endif + config_host_data.set('CONFIG_AUDIO_DRIVERS', + '"' + '", "'.join(audio_drivers_selected) + '", ') +else foreach k: get_option('audio_drv_list') - if k =3D=3D 'default' - audio_drivers_selected +=3D audio_drivers_default - elif not audio_drivers_available[k] - error('Audio driver "@0@" not available.'.format(k)) - else - audio_drivers_selected +=3D k + if k !=3D 'default' + error('Audio drivers are not supported because audio is disabled.') endif endforeach endif -config_host_data.set('CONFIG_AUDIO_DRIVERS', - '"' + '", "'.join(audio_drivers_selected) + '", ') =20 have_host_block_device =3D (host_os !=3D 'darwin' or cc.has_header('IOKit/storage/IOMedia.h')) @@ -4684,7 +4693,8 @@ if enable_modules summary_info +=3D {'alternative module path': get_option('module_upgrade= s')} endif summary_info +=3D {'fuzzing support': get_option('fuzzing')} -if have_system +summary_info +=3D {'Audio support': have_audio} +if have_audio summary_info +=3D {'Audio drivers': ' '.join(audio_drivers_selected)} endif summary_info +=3D {'Trace backends': ','.join(get_option('trace_backend= s'))} --=20 2.34.1