[PATCH 0/8] add build option to disable audio subsystem

Sergei Heifetz posted 8 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260217052740.114117-1-heifetz@yandex-team.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
Kconfig.host                |  3 ++
audio/audio-hmp-cmds-stub.c | 28 +++++++++++++
audio/audio-stub.c          | 35 ++++++++++++++++
audio/meson.build           |  5 +++
configure                   |  4 ++
hw/audio/Kconfig            | 21 ++++++----
hw/audio/pcspk.c            | 14 +++++++
hw/usb/Kconfig              |  2 +-
meson.build                 | 83 +++++++++++++++++++++----------------
meson_options.txt           |  3 ++
qapi/audio.json             |  3 +-
replay/meson.build          |  9 +++-
replay/replay-audio-stub.c  | 16 +++++++
replay/stubs-system.c       |  6 ---
system/vl.c                 |  6 +++
tests/qtest/libqtest.c      |  2 +
ui/vnc.c                    | 31 ++++++++++++--
17 files changed, 215 insertions(+), 56 deletions(-)
create mode 100644 audio/audio-hmp-cmds-stub.c
create mode 100644 audio/audio-stub.c
create mode 100644 replay/replay-audio-stub.c
[PATCH 0/8] add build option to disable audio subsystem
Posted by Sergei Heifetz 1 month, 3 weeks ago
This patch series adds a compile-time option to disable building
audio-related sources (mostly, files under `audio/` and `hw/audio/`).
It adds `--disable-audio` and `--enable-audio` options to the
`configure` script. Audio remains enabled by default, and the changes are
harmless in that case.

When audio is disabled, it may not be possible to build a number of
devices and machines. This is expected, and can be addressed on a
case-by-case basis if needed.

This feature may be useful in production environments which only use a
specific subset of QEMU’s functionality and, in particular, do not need
the audio subsystem. In such environments it is generally beneficial to
avoid building unused code, for both security and maintenance reasons.

Sergei Heifetz (8):
  audio: add `audio` build option for meson and Kconfig
  ui/vnc: disable audio feature when configured with --disable-audio
  tests/qtest: remove -audio none when configured with --disable-audio
  hw/audio/pcspk: change PCSPK behaviour with --disable-audio
  Kconfig: add AUDIO dependency to audio-related devices
  system/vl: remove audio and audiodev options when audio is disabled
  audio: do not build audio-related sources with --disable-audio
  meson.build: ignore audio drivers when configured with --disable-audio

 Kconfig.host                |  3 ++
 audio/audio-hmp-cmds-stub.c | 28 +++++++++++++
 audio/audio-stub.c          | 35 ++++++++++++++++
 audio/meson.build           |  5 +++
 configure                   |  4 ++
 hw/audio/Kconfig            | 21 ++++++----
 hw/audio/pcspk.c            | 14 +++++++
 hw/usb/Kconfig              |  2 +-
 meson.build                 | 83 +++++++++++++++++++++----------------
 meson_options.txt           |  3 ++
 qapi/audio.json             |  3 +-
 replay/meson.build          |  9 +++-
 replay/replay-audio-stub.c  | 16 +++++++
 replay/stubs-system.c       |  6 ---
 system/vl.c                 |  6 +++
 tests/qtest/libqtest.c      |  2 +
 ui/vnc.c                    | 31 ++++++++++++--
 17 files changed, 215 insertions(+), 56 deletions(-)
 create mode 100644 audio/audio-hmp-cmds-stub.c
 create mode 100644 audio/audio-stub.c
 create mode 100644 replay/replay-audio-stub.c

-- 
2.34.1


Re: [PATCH 0/8] add build option to disable audio subsystem
Posted by Marc-André Lureau 1 month, 3 weeks ago
Hi Sergei

On Tue, Feb 17, 2026 at 6:28 AM Sergei Heifetz <heifetz@yandex-team.com> wrote:
>
> This patch series adds a compile-time option to disable building
> audio-related sources (mostly, files under `audio/` and `hw/audio/`).
> It adds `--disable-audio` and `--enable-audio` options to the
> `configure` script. Audio remains enabled by default, and the changes are
> harmless in that case.
>
> When audio is disabled, it may not be possible to build a number of
> devices and machines. This is expected, and can be addressed on a
> case-by-case basis if needed.
>
> This feature may be useful in production environments which only use a
> specific subset of QEMU’s functionality and, in particular, do not need
> the audio subsystem. In such environments it is generally beneficial to
> avoid building unused code, for both security and maintenance reasons.


I am planning to send a PR for "[PATCH 00/85] audio: cleanups & add a
manual test" soon, could you rebase your series on top?

thanks




>
> Sergei Heifetz (8):
>   audio: add `audio` build option for meson and Kconfig
>   ui/vnc: disable audio feature when configured with --disable-audio
>   tests/qtest: remove -audio none when configured with --disable-audio
>   hw/audio/pcspk: change PCSPK behaviour with --disable-audio
>   Kconfig: add AUDIO dependency to audio-related devices
>   system/vl: remove audio and audiodev options when audio is disabled
>   audio: do not build audio-related sources with --disable-audio
>   meson.build: ignore audio drivers when configured with --disable-audio
>
>  Kconfig.host                |  3 ++
>  audio/audio-hmp-cmds-stub.c | 28 +++++++++++++
>  audio/audio-stub.c          | 35 ++++++++++++++++
>  audio/meson.build           |  5 +++
>  configure                   |  4 ++
>  hw/audio/Kconfig            | 21 ++++++----
>  hw/audio/pcspk.c            | 14 +++++++
>  hw/usb/Kconfig              |  2 +-
>  meson.build                 | 83 +++++++++++++++++++++----------------
>  meson_options.txt           |  3 ++
>  qapi/audio.json             |  3 +-
>  replay/meson.build          |  9 +++-
>  replay/replay-audio-stub.c  | 16 +++++++
>  replay/stubs-system.c       |  6 ---
>  system/vl.c                 |  6 +++
>  tests/qtest/libqtest.c      |  2 +
>  ui/vnc.c                    | 31 ++++++++++++--
>  17 files changed, 215 insertions(+), 56 deletions(-)
>  create mode 100644 audio/audio-hmp-cmds-stub.c
>  create mode 100644 audio/audio-stub.c
>  create mode 100644 replay/replay-audio-stub.c
>
> --
> 2.34.1
>
>


-- 
Marc-André Lureau
Re: [PATCH 0/8] add build option to disable audio subsystem
Posted by Sergei Heifetz 1 month, 3 weeks ago
On 2/17/26 14:58, Marc-André Lureau wrote:
> I am planning to send a PR for "[PATCH 00/85] audio: cleanups & add a
> manual test" soon, could you rebase your series on top?
Hi. Yes, sure.