{"id":2197103,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2197103/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260217052740.114117-8-heifetz@yandex-team.com>","date":"2026-02-17T05:27:39","name":"[7/8] audio: do not build audio-related sources with --disable-audio","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"0adf7088e5bd2ecb271f9c539ba33b7516d82c0a","submitter":{"id":92578,"url":"http://patchwork.ozlabs.org/api/1.0/people/92578/?format=json","name":"Sergei Heifetz","email":"heifetz@yandex-team.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260217052740.114117-8-heifetz@yandex-team.com/mbox/","series":[{"id":492371,"url":"http://patchwork.ozlabs.org/api/1.0/series/492371/?format=json","date":"2026-02-17T05:27:32","name":"add build option to disable audio subsystem","version":1,"mbox":"http://patchwork.ozlabs.org/series/492371/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2197103/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=yandex-team.com header.i=@yandex-team.com\n header.a=rsa-sha256 header.s=default header.b=fihEtUMM;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)","mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net;\n dkim=pass header.i=@yandex-team.com"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fFSrD3Jc6z1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 16:29:32 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vsDcs-0002ce-97; Tue, 17 Feb 2026 00:27:58 -0500","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <heifetz@yandex-team.com>)\n id 1vsDcn-0002bH-UI\n for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:54 -0500","from forwardcorp1b.mail.yandex.net ([178.154.239.136])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <heifetz@yandex-team.com>)\n id 1vsDcl-0006cf-0K\n for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:53 -0500","from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net\n (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net\n [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0])\n by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id C194B88512;\n Tue, 17 Feb 2026 08:27:49 +0300 (MSK)","from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f])\n by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net\n (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-vRBzQ9c3;\n Tue, 17 Feb 2026 08:27:49 +0300"],"X-Yandex-Fwd":"1","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com;\n s=default; t=1771306069;\n bh=KOIC+LeyRr+/hCkiVzFTFc9lUuFTGE4xjJnMyvrIrZo=;\n h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From;\n b=fihEtUMMqawgP7lWr3b396EpVGug+Amj1lArchR8/HsUdhChFTXEnt+qnpiOYMks8\n +ht0xYUWppwA0Y5aKoUdXVKyri0gdtKfTKQkS/kKv0iZ7AN1O1W3HRHR4lVy6bE+rG\n uZQBbb3aMmkATLo4r6z5lpa3KXb8y3qZcY5t+ROY=","From":"Sergei Heifetz <heifetz@yandex-team.com>","To":"qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, =?utf-8?q?A?=\n\t=?utf-8?q?lex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Eric Blake <eblake@redhat.com>,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n\t=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>,\n Markus Armbruster <armbru@redhat.com>, Fabiano Rosas <farosas@suse.de>,\n Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>,\n Gerd Hoffmann <kraxel@redhat.com>, Laurent Vivier <lvivier@redhat.com>","Subject":"[PATCH 7/8] audio: do not build audio-related sources with\n --disable-audio","Date":"Tue, 17 Feb 2026 10:27:39 +0500","Message-Id":"<20260217052740.114117-8-heifetz@yandex-team.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260217052740.114117-1-heifetz@yandex-team.com>","References":"<20260217052740.114117-1-heifetz@yandex-team.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=178.154.239.136;\n 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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n 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 <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"When QEMU is configured with `--disable-audio`, do not build any\naudio-related sources.\n\n- audio/meson.build and replay/meson.build:\n  Exclude audio-related sources when audio is disabled.\n\n- audio/audio-stub.c:\n  Provide a minimal set of straightforward stubs.\n\n- replay/replay-audio-stub.c:\n  Move the existing stubs from replay/stubs-system.c into a separate\n  file.\n\n- qapi/audio.json:\n  Remove the QMP `query-audiodevs` command.\n\n- audio/audio-hmp-cmds-stub.c:\n  Provide meaningful messages for audio-related HMP commands:\n  stopcapture, wavcapture, info capture.\n\nSigned-off-by: Sergei Heifetz <heifetz@yandex-team.com>\n---\n audio/audio-hmp-cmds-stub.c | 28 ++++++++++++++++++++++++++++\n audio/audio-stub.c          | 35 +++++++++++++++++++++++++++++++++++\n audio/meson.build           |  5 +++++\n qapi/audio.json             |  3 ++-\n replay/meson.build          |  9 ++++++++-\n replay/replay-audio-stub.c  | 16 ++++++++++++++++\n replay/stubs-system.c       |  6 ------\n 7 files changed, 94 insertions(+), 8 deletions(-)\n create mode 100644 audio/audio-hmp-cmds-stub.c\n create mode 100644 audio/audio-stub.c\n create mode 100644 replay/replay-audio-stub.c","diff":"diff --git a/audio/audio-hmp-cmds-stub.c b/audio/audio-hmp-cmds-stub.c\nnew file mode 100644\nindex 0000000000..2f94f1c8dd\n--- /dev/null\n+++ b/audio/audio-hmp-cmds-stub.c\n@@ -0,0 +1,28 @@\n+/*\n+ * Stub for audio-hmp-cmds.c\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include \"qemu/osdep.h\"\n+#include \"audio_int.h\"\n+#include \"monitor/hmp.h\"\n+#include \"monitor/monitor.h\"\n+#include \"qapi/error.h\"\n+#include \"qobject/qdict.h\"\n+#include \"qemu/error-report.h\"\n+\n+void hmp_info_capture(Monitor *mon, const QDict *qdict)\n+{\n+    monitor_puts(mon, \"audio subsystem is disabled at compile time\");\n+}\n+\n+void hmp_stopcapture(Monitor *mon, const QDict *qdict)\n+{\n+    monitor_puts(mon, \"audio subsystem is disabled at compile time\");\n+}\n+\n+void hmp_wavcapture(Monitor *mon, const QDict *qdict)\n+{\n+    monitor_puts(mon, \"audio subsystem is disabled at compile time\");\n+}\ndiff --git a/audio/audio-stub.c b/audio/audio-stub.c\nnew file mode 100644\nindex 0000000000..0c9e2446e0\n--- /dev/null\n+++ b/audio/audio-stub.c\n@@ -0,0 +1,35 @@\n+/*\n+ * Stub for audio.c\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include \"qemu/osdep.h\"\n+#include \"qapi/qapi-commands-audio.h\"\n+#include \"qemu/audio.h\"\n+#include \"qapi/error.h\"\n+\n+void audio_cleanup(void) {}\n+\n+AudioBackend *audio_be_by_name(const char *name, Error **errp)\n+{\n+  error_setg(\n+      errp,\n+      \"trying to find audiodev '%s' by name with audio component disabled\",\n+      name);\n+  return NULL;\n+}\n+\n+const char *audio_be_get_id(AudioBackend *be) { return \"\"; }\n+\n+bool audio_be_set_dbus_server(AudioBackend *be,\n+                              GDBusObjectManagerServer *server, bool p2p,\n+                              Error **errp)\n+{\n+  error_setg(errp, \"trying to set dbus server with audio component disabled\");\n+  return false;\n+}\n+\n+void audio_init_audiodevs(void) {}\n+\n+void audio_create_default_audiodevs(void) {}\ndiff --git a/audio/meson.build b/audio/meson.build\nindex b2dca2c640..ea1f88fb6f 100644\n--- a/audio/meson.build\n+++ b/audio/meson.build\n@@ -1,3 +1,8 @@\n+if not audio_enabled\n+  system_ss.add(files('audio-stub.c', 'audio-hmp-cmds-stub.c'))\n+  subdir_done()\n+endif\n+\n system_ss.add(files(\n   'audio.c',\n   'mixeng.c',\ndiff --git a/qapi/audio.json b/qapi/audio.json\nindex 2df87b9710..28fda7c8ac 100644\n--- a/qapi/audio.json\n+++ b/qapi/audio.json\n@@ -540,4 +540,5 @@\n # Since: 8.0\n ##\n { 'command': 'query-audiodevs',\n-  'returns': ['Audiodev'] }\n+  'returns': ['Audiodev'],\n+  'if': 'CONFIG_AUDIO' }\ndiff --git a/replay/meson.build b/replay/meson.build\nindex 4b4175e8dd..7f8b5dca61 100644\n--- a/replay/meson.build\n+++ b/replay/meson.build\n@@ -7,7 +7,14 @@ system_ss.add(when: 'CONFIG_TCG', if_true: files(\n   'replay-char.c',\n   'replay-snapshot.c',\n   'replay-net.c',\n-  'replay-audio.c',\n   'replay-random.c',\n   'replay-debugging.c',\n ), if_false: files('stubs-system.c'))\n+\n+if audio_enabled\n+  system_ss.add(when: 'CONFIG_TCG',\n+  if_true: files('replay-audio.c'),\n+  if_false: files('replay-audio-stub.c'))\n+else\n+  system_ss.add(files('replay-audio-stub.c'))\n+endif\ndiff --git a/replay/replay-audio-stub.c b/replay/replay-audio-stub.c\nnew file mode 100644\nindex 0000000000..303e5075f4\n--- /dev/null\n+++ b/replay/replay-audio-stub.c\n@@ -0,0 +1,16 @@\n+/*\n+ * Stub for replay-audio.c\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include \"qemu/osdep.h\"\n+#include \"system/replay.h\"\n+\n+void replay_audio_in(size_t *recorded, st_sample *samples,\n+                     size_t *wpos, size_t size)\n+{\n+}\n+void replay_audio_out(size_t *played)\n+{\n+}\ndiff --git a/replay/stubs-system.c b/replay/stubs-system.c\nindex 7f85764936..454415ae8e 100644\n--- a/replay/stubs-system.c\n+++ b/replay/stubs-system.c\n@@ -15,12 +15,6 @@ void replay_input_sync_event(void)\n void replay_add_blocker(const char *feature)\n {\n }\n-void replay_audio_in(size_t *recorded, st_sample *samples, size_t *wpos, size_t size)\n-{\n-}\n-void replay_audio_out(size_t *played)\n-{\n-}\n void replay_breakpoint(void)\n {\n }\n","prefixes":["7/8"]}