[PATCH v2 07/10] ui/dbus: run without Audio interface when audio is disabled

Sergei Heifetz posted 10 patches 1 month, 2 weeks ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH v2 07/10] ui/dbus: run without Audio interface when audio is disabled
Posted by Sergei Heifetz 1 month, 2 weeks ago
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’t been changed.)

Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
---
 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;
     }
 
+#ifdef CONFIG_AUDIO
     {
         AudioBackend *audio_be = 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
 
     consoles = g_array_new(FALSE, FALSE, sizeof(guint32));
     for (idx = 0;; idx++) {
-- 
2.34.1


Re: [PATCH v2 07/10] ui/dbus: run without Audio interface when audio is disabled
Posted by Marc-André Lureau 1 month, 2 weeks ago
Hi

On Mon, Feb 23, 2026 at 9:26 PM Sergei Heifetz <heifetz@yandex-team.com> wrote:
>
> 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`.
>

I think it should also disable "audiodev" (from QAPI DisplayDBus etc).
Or at the minimum, it should return an error if the option is given
and qemu is compiled with !CONFIG_AUDIO.


> (The current handling of the situation when audio is enabled but
> no D-Bus-compatible audio backend is available is different and
> hasn’t been changed.)
>
> Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
> ---
>  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;
>      }
>
> +#ifdef CONFIG_AUDIO
>      {
>          AudioBackend *audio_be = 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
>
>      consoles = g_array_new(FALSE, FALSE, sizeof(guint32));
>      for (idx = 0;; idx++) {
> --
> 2.34.1
>
>


--
Marc-André Lureau
Re: [PATCH v2 07/10] ui/dbus: run without Audio interface when audio is disabled
Posted by Sergei Heifetz 1 month, 2 weeks ago
On 2/24/26 16:06, Marc-André Lureau wrote:
> Hi
>
> On Mon, Feb 23, 2026 at 9:26 PM Sergei Heifetz <heifetz@yandex-team.com> wrote:
>> 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`.
>>
> I think it should also disable "audiodev" (from QAPI DisplayDBus etc).
> Or at the minimum, it should return an error if the option is given
> and qemu is compiled with !CONFIG_AUDIO.
OK, I’ll remove `audiodev`, then.
>
>> (The current handling of the situation when audio is enabled but
>> no D-Bus-compatible audio backend is available is different and
>> hasn’t been changed.)
>>
>> Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
>> ---
>>   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;
>>       }
>>
>> +#ifdef CONFIG_AUDIO
>>       {
>>           AudioBackend *audio_be = 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
>>
>>       consoles = g_array_new(FALSE, FALSE, sizeof(guint32));
>>       for (idx = 0;; idx++) {
>> --
>> 2.34.1
>>
>>
>
> --
> Marc-André Lureau