From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875320435393.3853880177453; Mon, 25 Apr 2022 01:28:40 -0700 (PDT) Received: from localhost ([::1]:47472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niu5H-00014o-Bh for importer2@patchew.org; Mon, 25 Apr 2022 04:28:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu06-0006UN-4e for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002ez-Nf for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:17 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-266-9gy9kMOjOAu57NWLtiFpeQ-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wr1-f69.google.com with SMTP id l7-20020adfa387000000b0020acc61dbaeso1628974wrb.7 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id d5-20020a056000186500b0020a8688963bsm9893771wri.89.2022.04.25.01.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:03 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 0A1C167B1B56; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CCG6lGxpSFBkTA/SRjKupJwKzVuo/aed5sg+24tDo9Y=; b=eYUJjFomUJ+noMS4sdTawLJGoaL9+4XvXKqHeAkqJtURHIlvWLa1ua9sVm2TPV46B4yWre j7jJbf4ttFysCHx6Vue3PgmGYP6l4LBEaEnPCb+M91BC5D95HB/21IIW09jo/bl3R15gJz TrppubIEJI+gwPMs7QLx/U5pNCpE/F4= X-MC-Unique: 9gy9kMOjOAu57NWLtiFpeQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CCG6lGxpSFBkTA/SRjKupJwKzVuo/aed5sg+24tDo9Y=; b=tLTYe6EmUJg5pyeNabpGc9Oa1CXPhezqdOVZuPVJU3GwECClMHxXjROCnBmN6W+6J2 AZz8IB+LHwsqil2tmmDFJxbTCjX5C8kMr77LYhiGZ7oAjqwW8Fs40TT7zK0Gk7wgL1b1 Ds8Dj8odNWDP0CzfR50SQ+n80UiRFP6V+noyq4LFzBZXy5aOWxX6lEdzwGK/4cKeyKYL YU5+Un8/zvn+6eVLlXgcdWsQQaeyOi3E4w3jgXFiGQ2D0XnraxO9nnSNTQdnLXP+EzCe jlUI/9bLx1KenD5DJDsY4nS6NbhfTGGfa9jhkd9lHzk0qiVo16W+l9BhZ3PgQbHQ3edv jLTg== X-Gm-Message-State: AOAM533cU5jtRlKkgGtPWuVIiGC5hQGijBnbR3fZV4WDMh5tWWYKHwC3 t/WSnaCw9Mdkx7hNg0rNnhzItEYU1Fte5Fq6MXUE3GDf2NdzG5cpq1YvGxvzvQkH7XPivkhGS1O rQ3kLWLD6GnQ4/fI= X-Received: by 2002:a05:6000:502:b0:20a:d9d2:ccea with SMTP id a2-20020a056000050200b0020ad9d2cceamr3777304wrf.128.1650874924279; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztKBtML27ZuiUtmzFLfKd6O/K6tVFp8geq/7fMHO15eeahyGft38H6PnhGczSO8d9R+GOhaQ== X-Received: by 2002:a05:6000:502:b0:20a:d9d2:ccea with SMTP id a2-20020a056000050200b0020ad9d2cceamr3777285wrf.128.1650874923912; Mon, 25 Apr 2022 01:22:03 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 01/18] hw/audio: Remove -soundhw support Date: Mon, 25 Apr 2022 10:21:44 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875356276100001 Content-Type: text/plain; charset="utf-8" One thing I am not sure about is whether to keep the aliases of ac97 and es1370 in the qdev_alias_table. Signed-off-by: Martin Kletzander Reviewed-by: Stefan Hajnoczi --- docs/about/deprecated.rst | 9 - docs/about/removed-features.rst | 10 + docs/qdev-device-use.txt | 21 +-- docs/replay.txt | 2 +- hw/audio/ac97.c | 3 - hw/audio/adlib.c | 2 - hw/audio/cs4231a.c | 2 - hw/audio/es1370.c | 3 - hw/audio/gus.c | 2 - hw/audio/intel-hda.c | 21 --- hw/audio/meson.build | 1 - hw/audio/pcspk.c | 11 -- hw/audio/sb16.c | 3 - hw/audio/soundhw.c | 177 ------------------ include/hw/audio/soundhw.h | 15 -- qemu-options.hx | 27 --- .../codeconverter/test_regexps.py | 1 - softmmu/qdev-monitor.c | 2 - softmmu/vl.c | 6 - 19 files changed, 19 insertions(+), 299 deletions(-) delete mode 100644 hw/audio/soundhw.c delete mode 100644 include/hw/audio/soundhw.h diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index cf02ef6821e4..7ba71ebd3435 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -39,15 +39,6 @@ should specify an ``audiodev=3D`` property. Additionall= y, when using vnc, you should specify an ``audiodev=3D`` property if you plan to transmit audio through the VNC protocol. =20 -Creating sound card devices using ``-soundhw`` (since 5.1) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Sound card devices should be created using ``-device`` instead. The -names are the same for most devices. The exceptions are ``hda`` which -needs two devices (``-device intel-hda -device hda-duplex``) and -``pcspk`` which can be activated using ``-machine -pcspk-audiodev=3D``. - ``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 4b831ea29176..086ba3edb042 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -336,6 +336,16 @@ for the RISC-V ``virt`` machine and ``sifive_u`` machi= ne. The ``-no-quit`` was a synonym for ``-display ...,window-close=3Doff`` whi= ch should be used instead. =20 +Creating sound card devices using ``-soundhw`` (removed in 7.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Sound card devices should be created using ``-device`` instead. The +names are the same for most devices. The exceptions are ``hda`` which +needs two devices (``-device intel-hda -device hda-duplex``) and +``pcspk`` which can be activated using ``-machine +pcspk-audiodev=3D``. And ``AC97`` and ``ES1370`` now have to be +specified in uppercase. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt index 240888933482..30e7eaa3e66d 100644 --- a/docs/qdev-device-use.txt +++ b/docs/qdev-device-use.txt @@ -311,21 +311,16 @@ constraints. =20 Host and guest part of audio devices have always been separate. =20 -The old way to define guest audio devices is -soundhw C1,... +Host side (backend) is defined using -audiodev with a specific driver: =20 -The new way is to define each guest audio device separately with --device. + spice + pa + none =20 -Map from -soundhw sound card name to -device: - - ac97 -device AC97 - cs4231a -device cs4231a,iobase=3DIOADDR,irq=3DIRQ,dma=3DDMA - es1370 -device ES1370 - gus -device gus,iobase=3DIOADDR,irq=3DIRQ,dma=3DDMA,freq=3DF - hda -device intel-hda,msi=3DMSI -device hda-duplex - sb16 -device sb16,iobase=3DIOADDR,irq=3DIRQ,dma=3DDMA,dma16=3DD= MA16,version=3DV - adlib not yet available with -device - pcspk not yet available with -device +And each guest audio device is then defined with -device with +audiodev=3DAUDIODEV_ID that refers to the audio backend above. Exceptions= are +pcspk and adlib which are note yet available with -device and are part of a +machine type. =20 For PCI devices, you can add bus=3DPCI-BUS,addr=3DDEVFN to control the PCI device address, as usual. diff --git a/docs/replay.txt b/docs/replay.txt index 5b008ca4911f..c329767c148a 100644 --- a/docs/replay.txt +++ b/docs/replay.txt @@ -294,7 +294,7 @@ Audio devices =20 Audio data is recorded and replay automatically. The command line for reco= rding and replaying must contain identical specifications of audio hardware, e.g= .: - -soundhw ac97 + -audiodev driver=3Dpa -device ac97,audiodev=3Daudio0 =20 Serial ports ------------ diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 3cb81310607f..fd0b3b97d5b5 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -18,7 +18,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "hw/qdev-properties.h" @@ -1430,8 +1429,6 @@ static const TypeInfo ac97_info =3D { static void ac97_register_types (void) { type_register_static (&ac97_info); - deprecated_register_soundhw("ac97", "Intel 82801AA AC97 Audio", - 0, TYPE_AC97); } =20 type_init (ac97_register_types) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 5f979b1487d1..ba1be6c8378d 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -322,7 +321,6 @@ static const TypeInfo adlib_info =3D { static void adlib_register_types (void) { type_register_static (&adlib_info); - deprecated_register_soundhw("adlib", ADLIB_DESC, 1, TYPE_ADLIB); } =20 type_init (adlib_register_types) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 0723e3943044..f510b862efbe 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -717,7 +716,6 @@ static const TypeInfo cs4231a_info =3D { static void cs4231a_register_types (void) { type_register_static (&cs4231a_info); - deprecated_register_soundhw("cs4231a", "CS4231A", 1, TYPE_CS4231A); } =20 type_init (cs4231a_register_types) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 690458981471..62359b84f279 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -27,7 +27,6 @@ #define SILENT_ES1370 =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" @@ -923,8 +922,6 @@ static const TypeInfo es1370_info =3D { static void es1370_register_types (void) { type_register_static (&es1370_info); - deprecated_register_soundhw("es1370", "ENSONIQ AudioPCI ES1370", - 0, TYPE_ES1370); } =20 type_init (es1370_register_types) diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 42f010b67193..c7710a684b88 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -317,7 +316,6 @@ static const TypeInfo gus_info =3D { static void gus_register_types (void) { type_register_static (&gus_info); - deprecated_register_soundhw("gus", "Gravis Ultrasound GF1", 1, TYPE_GU= S); } =20 type_init (gus_register_types) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index bc77e3d8c9dc..e77552363a4c 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -26,7 +26,6 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qemu/error-report.h" -#include "hw/audio/soundhw.h" #include "intel-hda.h" #include "migration/vmstate.h" #include "intel-hda-defs.h" @@ -1307,25 +1306,6 @@ static const TypeInfo hda_codec_device_type_info =3D= { .class_init =3D hda_codec_device_class_init, }; =20 -/* - * create intel hda controller with codec attached to it, - * so '-soundhw hda' works. - */ -static int intel_hda_and_codec_init(PCIBus *bus) -{ - DeviceState *controller; - BusState *hdabus; - DeviceState *codec; - - warn_report("'-soundhw hda' is deprecated, " - "please use '-device intel-hda -device hda-duplex' instead= "); - controller =3D DEVICE(pci_create_simple(bus, -1, "intel-hda")); - hdabus =3D QLIST_FIRST(&controller->child_bus); - codec =3D qdev_new("hda-duplex"); - qdev_realize_and_unref(codec, hdabus, &error_fatal); - return 0; -} - static void intel_hda_register_types(void) { type_register_static(&hda_codec_bus_info); @@ -1333,7 +1313,6 @@ static void intel_hda_register_types(void) type_register_static(&intel_hda_info_ich6); type_register_static(&intel_hda_info_ich9); type_register_static(&hda_codec_device_type_info); - pci_register_soundhw("hda", "Intel HD Audio", intel_hda_and_codec_init= ); } =20 type_init(intel_hda_register_types) diff --git a/hw/audio/meson.build b/hw/audio/meson.build index e48a9fc73d57..746b5b98d198 100644 --- a/hw/audio/meson.build +++ b/hw/audio/meson.build @@ -1,4 +1,3 @@ -softmmu_ss.add(files('soundhw.c')) softmmu_ss.add(when: 'CONFIG_AC97', if_true: files('ac97.c')) softmmu_ss.add(when: 'CONFIG_ADLIB', if_true: files('fmopl.c', 'adlib.c')) softmmu_ss.add(when: 'CONFIG_CS4231', if_true: files('cs4231.c')) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index dfc7ebca4e17..72bea5fb202a 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -24,7 +24,6 @@ =20 #include "qemu/osdep.h" #include "hw/isa/isa.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "qemu/module.h" #include "qemu/timer.h" @@ -245,18 +244,8 @@ static const TypeInfo pcspk_info =3D { .class_init =3D pcspk_class_initfn, }; =20 -static int pcspk_audio_init_soundhw(ISABus *bus) -{ - PCSpkState *s =3D pcspk_state; - - warn_report("'-soundhw pcspk' is deprecated, " - "please set a backend using '-machine pcspk-audiodev=3D' instead"); - return pcspk_audio_init(s); -} - static void pcspk_register(void) { type_register_static(&pcspk_info); - isa_register_soundhw("pcspk", "PC speaker", pcspk_audio_init_soundhw); } type_init(pcspk_register) diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 2215386ddb2e..593da2478c14 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -1469,8 +1468,6 @@ static const TypeInfo sb16_info =3D { static void sb16_register_types (void) { type_register_static (&sb16_info); - deprecated_register_soundhw("sb16", "Creative Sound Blaster 16", - 1, TYPE_SB16); } =20 type_init (sb16_register_types) diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c deleted file mode 100644 index 173b674ff53a..000000000000 --- a/hw/audio/soundhw.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * QEMU System Emulator - * - * Copyright (c) 2003-2008 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ -#include "qemu/osdep.h" -#include "qemu/option.h" -#include "qemu/help_option.h" -#include "qemu/error-report.h" -#include "qom/object.h" -#include "hw/isa/isa.h" -#include "hw/pci/pci.h" -#include "hw/audio/soundhw.h" - -struct soundhw { - const char *name; - const char *descr; - const char *typename; - int enabled; - int isa; - union { - int (*init_isa) (ISABus *bus); - int (*init_pci) (PCIBus *bus); - } init; -}; - -static struct soundhw soundhw[9]; -static int soundhw_count; - -void isa_register_soundhw(const char *name, const char *descr, - int (*init_isa)(ISABus *bus)) -{ - assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); - soundhw[soundhw_count].name =3D name; - soundhw[soundhw_count].descr =3D descr; - soundhw[soundhw_count].isa =3D 1; - soundhw[soundhw_count].init.init_isa =3D init_isa; - soundhw_count++; -} - -void pci_register_soundhw(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus)) -{ - assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); - soundhw[soundhw_count].name =3D name; - soundhw[soundhw_count].descr =3D descr; - soundhw[soundhw_count].isa =3D 0; - soundhw[soundhw_count].init.init_pci =3D init_pci; - soundhw_count++; -} - -void deprecated_register_soundhw(const char *name, const char *descr, - int isa, const char *typename) -{ - assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); - soundhw[soundhw_count].name =3D name; - soundhw[soundhw_count].descr =3D descr; - soundhw[soundhw_count].isa =3D isa; - soundhw[soundhw_count].typename =3D typename; - soundhw_count++; -} - -void select_soundhw(const char *optarg) -{ - struct soundhw *c; - - if (is_help_option(optarg)) { - show_valid_cards: - - if (soundhw_count) { - printf("Valid sound card names (comma separated):\n"); - for (c =3D soundhw; c->name; ++c) { - printf ("%-11s %s\n", c->name, c->descr); - } - printf("\n-soundhw all will enable all of the above\n"); - } else { - printf("Machine has no user-selectable audio hardware " - "(it may or may not have always-present audio hardware= ).\n"); - } - exit(!is_help_option(optarg)); - } - else { - size_t l; - const char *p; - char *e; - int bad_card =3D 0; - - if (!strcmp(optarg, "all")) { - for (c =3D soundhw; c->name; ++c) { - c->enabled =3D 1; - } - return; - } - - p =3D optarg; - while (*p) { - e =3D strchr(p, ','); - l =3D !e ? strlen(p) : (size_t) (e - p); - - for (c =3D soundhw; c->name; ++c) { - if (!strncmp(c->name, p, l) && !c->name[l]) { - c->enabled =3D 1; - break; - } - } - - if (!c->name) { - if (l > 80) { - error_report("Unknown sound card name (too big to show= )"); - } - else { - error_report("Unknown sound card name `%.*s'", - (int) l, p); - } - bad_card =3D 1; - } - p +=3D l + (e !=3D NULL); - } - - if (bad_card) { - goto show_valid_cards; - } - } -} - -void soundhw_init(void) -{ - struct soundhw *c; - ISABus *isa_bus =3D (ISABus *) object_resolve_path_type("", TYPE_ISA_B= US, NULL); - PCIBus *pci_bus =3D (PCIBus *) object_resolve_path_type("", TYPE_PCI_B= US, NULL); - - for (c =3D soundhw; c->name; ++c) { - if (c->enabled) { - if (c->typename) { - warn_report("'-soundhw %s' is deprecated, " - "please use '-device %s' instead", - c->name, c->typename); - if (c->isa) { - isa_create_simple(isa_bus, c->typename); - } else { - pci_create_simple(pci_bus, -1, c->typename); - } - } else if (c->isa) { - if (!isa_bus) { - error_report("ISA bus not available for %s", c->name); - exit(1); - } - c->init.init_isa(isa_bus); - } else { - if (!pci_bus) { - error_report("PCI bus not available for %s", c->name); - exit(1); - } - c->init.init_pci(pci_bus); - } - } - } -} - diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h deleted file mode 100644 index f09a297854af..000000000000 --- a/include/hw/audio/soundhw.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HW_SOUNDHW_H -#define HW_SOUNDHW_H - -void isa_register_soundhw(const char *name, const char *descr, - int (*init_isa)(ISABus *bus)); - -void pci_register_soundhw(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus)); -void deprecated_register_soundhw(const char *name, const char *descr, - int isa, const char *typename); - -void soundhw_init(void); -void select_soundhw(const char *optarg); - -#endif diff --git a/qemu-options.hx b/qemu-options.hx index 34e9b32a5c00..47bbd86a4533 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -892,33 +892,6 @@ SRST ``qemu.wav``. ERST =20 -DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw, - "-soundhw c1,... enable audio support\n" - " and only specified sound cards (comma separated list)= \n" - " use '-soundhw help' to get the list of supported card= s\n" - " use '-soundhw all' to enable all of them\n", QEMU_ARC= H_ALL) -SRST -``-soundhw card1[,card2,...] or -soundhw all`` - Enable audio and selected sound hardware. Use 'help' to print all - available sound hardware. For example: - - .. parsed-literal:: - - |qemu_system_x86| -soundhw sb16,adlib disk.img - |qemu_system_x86| -soundhw es1370 disk.img - |qemu_system_x86| -soundhw ac97 disk.img - |qemu_system_x86| -soundhw hda disk.img - |qemu_system_x86| -soundhw all disk.img - |qemu_system_x86| -soundhw help - - Note that Linux's i810\_audio OSS kernel (for AC97) module might - require manually specifying clocking. - - :: - - modprobe i810_audio clocking=3D48000 -ERST - DEF("device", HAS_ARG, QEMU_OPTION_device, "-device driver[,prop[=3Dvalue][,...]]\n" " add device (based on driver)\n" diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/= codeconverter/codeconverter/test_regexps.py index a445634d88ac..0161cadffee6 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -264,7 +264,6 @@ def test_initial_includes(): #define SILENT_ES1370 =20 #include "qemu/osdep.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 12fe60c4670d..5c80d135ebf0 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -66,9 +66,7 @@ typedef struct QDevAlias =20 /* Please keep this table sorted by typename. */ static const QDevAlias qdev_alias_table[] =3D { - { "AC97", "ac97" }, /* -soundhw name */ { "e1000", "e1000-82540em" }, - { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, { "virtio-9p-device", "virtio-9p", QEMU_ARCH_VIRTIO_MMIO }, diff --git a/softmmu/vl.c b/softmmu/vl.c index 06a0e342fe9e..2f7158574e4f 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -80,7 +80,6 @@ #include "migration/snapshot.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" -#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h" @@ -2669,8 +2668,6 @@ static void qemu_create_cli_devices(void) { DeviceOption *opt; =20 - soundhw_init(); - qemu_opts_foreach(qemu_find_opts("fw_cfg"), parse_fw_cfg, fw_cfg_find(), &error_fatal); =20 @@ -3018,9 +3015,6 @@ void qemu_init(int argc, char **argv, char **envp) case QEMU_OPTION_audiodev: audio_parse_option(optarg); break; - case QEMU_OPTION_soundhw: - select_soundhw (optarg); - break; case QEMU_OPTION_h: help(0); break; --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875844345534.6339417986001; Mon, 25 Apr 2022 01:37:24 -0700 (PDT) Received: from localhost ([::1]:56196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuDj-0007IL-0R for importer2@patchew.org; Mon, 25 Apr 2022 04:37:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0p-0007Hh-EI for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:20741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0n-0002qh-Ff for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:03 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-Q3VfF7yzNLuhd0q3ew4maw-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f69.google.com with SMTP id q6-20020a1cf306000000b0038c5726365aso6872717wmq.3 for ; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id r17-20020a0560001b9100b00207afaa8987sm9545597wru.27.2022.04.25.01.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:02 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 15F3967B1B57; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650875040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lGr5ZYYCfBjIhbaCs5pjlimDwxXJN466WQPA6PrOrAg=; b=UVfZBd+hFXf7yBA8qF6Fj2M94zJat09hKaZOh+j8suNNpu+WmLke+OukDaC2HfKUoqAXYX alXBcxVkPtvhUUMLNAIJ36Y23Pm3Xy9kDpqWWjIZXytWKqNEjCGihN1YzGvxaQrVSjUIvM NwUkRK4tg4baZyfwoWA/c6KJzH6LB4o= X-MC-Unique: Q3VfF7yzNLuhd0q3ew4maw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lGr5ZYYCfBjIhbaCs5pjlimDwxXJN466WQPA6PrOrAg=; b=jKazsCdPTPk6pfjyjFTxfToxd2tqc8kwpgHyxGGyTwCw2zeLaTjuYA8WlfZoRuIpoh PRiIpENY7kZIIQF4liPZWrO+8Ck/fa4NOttR4Lts0lYLNMTu09wL0isfwyEJdt/1DDCK RluI2lFz1s0RtJW/5gz98kl4iszVgTvwKV6VvuAty1rskaT/bF5i9q1XG/V9TaammibS ujX3Mv1mmJ34vKpt2D9iVnbSNLeC89wVbPdAG42PaOGd2E/KyMUENe/uo+9qum5gi4Jm EInnT9hn1ueT1fV/7x/z5ql4P+foFuErvEqHoH4MzcwTMZoKitiBD8YCGMi2YH51SIfA HfYg== X-Gm-Message-State: AOAM531esxwTxwlwPLsFKgdj5saxrlGG7KQ9io/9cvMzNoO1dVRyFhDE 9EaB4R91RUSUq43uFbqaX7tAycC8hDMyiC2m5IDmRjw232PT3hwmvHgDgpfwz/LOIoDo7V+qJ3F zjE1Lsg90nRCh2JA= X-Received: by 2002:a05:600c:1552:b0:38e:c7a4:f056 with SMTP id f18-20020a05600c155200b0038ec7a4f056mr24931337wmg.183.1650874923828; Mon, 25 Apr 2022 01:22:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcPaXQaRYsRK7kFr7dw0OP7er2x/iw/gGtxg/5rbUQrr/TshLfhpO+Mel3UMnOji0xaPOGxg== X-Received: by 2002:a05:600c:1552:b0:38e:c7a4:f056 with SMTP id f18-20020a05600c155200b0038ec7a4f056mr24931297wmg.183.1650874923619; Mon, 25 Apr 2022 01:22:03 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 02/18] hw/input/tsc210x: Extract common init code into new function Date: Mon, 25 Apr 2022 10:21:45 +0200 Message-Id: <1d75877cf4cc2a38f87633ff16f9fea3e1bb0c03.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875845915100001 Content-Type: text/plain; charset="utf-8" This deduplicates several lines and will make future changes more concise. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- hw/input/tsc210x.c | 68 ++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 44 deletions(-) diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index df7313db5d7f..f16a8090b7c7 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -31,6 +31,7 @@ #include "hw/input/tsc2xxx.h" #include "hw/irq.h" #include "migration/vmstate.h" +#include "qapi/error.h" =20 #define TSC_DATA_REGISTERS_PAGE 0x0 #define TSC_CONTROL_REGISTERS_PAGE 0x1 @@ -1070,20 +1071,10 @@ static const VMStateDescription vmstate_tsc2301 =3D= { .fields =3D vmstatefields_tsc210x, }; =20 -uWireSlave *tsc2102_init(qemu_irq pint) +static void tsc210x_init(TSC210xState *s, + const char *name, + const VMStateDescription *vmsd) { - TSC210xState *s; - - s =3D g_new0(TSC210xState, 1); - s->x =3D 160; - s->y =3D 160; - s->pressure =3D 0; - s->precision =3D s->nextprecision =3D 0; - s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tsc210x_timer_tick, s); - s->pint =3D pint; - s->model =3D 0x2102; - s->name =3D "tsc2102"; - s->tr[0] =3D 0; s->tr[1] =3D 1; s->tr[2] =3D 1; @@ -1105,13 +1096,29 @@ uWireSlave *tsc2102_init(qemu_irq pint) =20 tsc210x_reset(s); =20 - qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, - "QEMU TSC2102-driven Touchscreen"); + qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, name); =20 AUD_register_card(s->name, &s->card); =20 qemu_register_reset((void *) tsc210x_reset, s); - vmstate_register(NULL, 0, &vmstate_tsc2102, s); + vmstate_register(NULL, 0, vmsd, s); +} + +uWireSlave *tsc2102_init(qemu_irq pint) +{ + TSC210xState *s; + + s =3D g_new0(TSC210xState, 1); + s->x =3D 160; + s->y =3D 160; + s->pressure =3D 0; + s->precision =3D s->nextprecision =3D 0; + s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tsc210x_timer_tick, s); + s->pint =3D pint; + s->model =3D 0x2102; + s->name =3D "tsc2102"; + + tsc210x_init(s, "QEMU TSC2102-driven Touchscreen", &vmstate_tsc2102); =20 return &s->chip; } @@ -1132,34 +1139,7 @@ uWireSlave *tsc2301_init(qemu_irq penirq, qemu_irq k= birq, qemu_irq dav) s->model =3D 0x2301; s->name =3D "tsc2301"; =20 - s->tr[0] =3D 0; - s->tr[1] =3D 1; - s->tr[2] =3D 1; - s->tr[3] =3D 0; - s->tr[4] =3D 1; - s->tr[5] =3D 0; - s->tr[6] =3D 1; - s->tr[7] =3D 0; - - s->chip.opaque =3D s; - s->chip.send =3D (void *) tsc210x_write; - s->chip.receive =3D (void *) tsc210x_read; - - s->codec.opaque =3D s; - s->codec.tx_swallow =3D (void *) tsc210x_i2s_swallow; - s->codec.set_rate =3D (void *) tsc210x_i2s_set_rate; - s->codec.in.fifo =3D s->in_fifo; - s->codec.out.fifo =3D s->out_fifo; - - tsc210x_reset(s); - - qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, - "QEMU TSC2301-driven Touchscreen"); - - AUD_register_card(s->name, &s->card); - - qemu_register_reset((void *) tsc210x_reset, s); - vmstate_register(NULL, 0, &vmstate_tsc2301, s); + tsc210x_init(s, "QEMU TSC2301-driven Touchscreen", &vmstate_tsc2301); =20 return &s->chip; } --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876478047283.4302635333943; Mon, 25 Apr 2022 01:47:58 -0700 (PDT) Received: from localhost ([::1]:44754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuNw-00021b-E8 for importer2@patchew.org; Mon, 25 Apr 2022 04:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu07-0006V1-Hh for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002f8-R2 for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:19 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262--F27XBhVMRWAv_Uy1Bpo_Q-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wr1-f70.google.com with SMTP id h61-20020adf9043000000b002079bbaa5d3so3076404wrh.16 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g5-20020adfd1e5000000b0020a97e7ba9fsm9606190wrd.92.2022.04.25.01.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:02 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 17F0967B1B58; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O++t1zATSSDRwugsXR7Q5IVUhnhLz0oadJiOZXGBQI8=; b=gxCq92NdSZCVw3Kj9Xxakla3B+v/m6rod9eq5YJsQCnloG3WylVNRefh8211wryzZMAVYz 10ktplgcipIN9lHH9VjJNIuTNPEb5D45/JiwzKrkgMPeHpGmv4fYcdVTUbH9zE13t9ca4B pLEqq1yKHgo9gAB1FzBwLyirwgKGuno= X-MC-Unique: -F27XBhVMRWAv_Uy1Bpo_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O++t1zATSSDRwugsXR7Q5IVUhnhLz0oadJiOZXGBQI8=; b=PSQyiO3w3IApHtf0WI43vNnNw/ck+AShYIf6xdFbsRlKdBoxZyS95TPbwMzKsIUyp4 QRHBCsvsPCZiP/+XFIhOgtci8Et+m6vwG7S5sCihtzC6TFXp7FmCJhdc4a27iX8j4QIF cvpLW4xlysCTmqzkpnXnqRMHDM9K6P7LGtCHkQAdhx5vBk6VOL/RuNqsUyLXVwfsWYZz 4JyQNn2fpkuBQ09sbhSRqkeKrgCrAYTeKltZF/iH+vfknh2O4tFuj/CnVsoVEgi+LjwP 8H7ehbpNp8yT0McN+PB9ZebQCj6zpn6e9IZGxM+keaMRUSp+qz1JIwBahGeUlKZsiv3J PT+Q== X-Gm-Message-State: AOAM532bo1Y0HZuOAOc55gAqL+JrbCzh/koQjvZfbWaTBdZLpvoUC1z9 87+DSQWi65rrsCEK4wd0N2f2Zk7x86tg3Z6NIDsUIb+DjcUBi7ZLCFaxZ15wOa3bBtxeIaXCFkj RJtkAxz2gZUlINf8= X-Received: by 2002:a05:600c:34c4:b0:38e:b628:da95 with SMTP id d4-20020a05600c34c400b0038eb628da95mr15717853wmq.150.1650874924305; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ppccZBgA9uskRcnwRbeAZSUgXdhxq0J4Qj9y/UaMbfOl3mTT83uTPV77spRbZYTUOCkj3g== X-Received: by 2002:a05:600c:34c4:b0:38e:b628:da95 with SMTP id d4-20020a05600c34c400b0038eb628da95mr15717824wmq.150.1650874924044; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 03/18] hw/audio: Simplify hda audio init Date: Mon, 25 Apr 2022 10:21:46 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876479706100001 Content-Type: text/plain; charset="utf-8" No return values are used anywhere, so switch the functions to be void and add support for error reporting using errp for use in next patches. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- hw/audio/hda-codec.c | 32 ++++++++++++++++++-------------- hw/audio/intel-hda.c | 4 +--- hw/audio/intel-hda.h | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index feb8f9e2bb7a..e86a2adf31a0 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -676,7 +676,9 @@ static void hda_audio_stream(HDACodecDevice *hda, uint3= 2_t stnr, bool running, b } } =20 -static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *de= sc) +static void hda_audio_init(HDACodecDevice *hda, + const struct desc_codec *desc, + Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); HDAAudioStream *st; @@ -719,7 +721,6 @@ static int hda_audio_init(HDACodecDevice *hda, const st= ruct desc_codec *desc) break; } } - return 0; } =20 static void hda_audio_exit(HDACodecDevice *hda) @@ -849,37 +850,40 @@ static Property hda_audio_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 -static int hda_audio_init_output(HDACodecDevice *hda) +static void hda_audio_init_output(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D &output_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, &output_nomixemu); - } else { - return hda_audio_init(hda, &output_mixemu); + desc =3D &output_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 -static int hda_audio_init_duplex(HDACodecDevice *hda) +static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D &duplex_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, &duplex_nomixemu); - } else { - return hda_audio_init(hda, &duplex_mixemu); + desc =3D &duplex_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 -static int hda_audio_init_micro(HDACodecDevice *hda) +static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D µ_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, µ_nomixemu); - } else { - return hda_audio_init(hda, µ_mixemu); + desc =3D µ_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 static void hda_audio_base_class_init(ObjectClass *klass, void *data) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index e77552363a4c..a17002812240 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -70,9 +70,7 @@ static void hda_codec_dev_realize(DeviceState *qdev, Erro= r **errp) return; } bus->next_cad =3D dev->cad + 1; - if (cdc->init(dev) !=3D 0) { - error_setg(errp, "HDA audio init failed"); - } + cdc->init(dev, errp); } =20 static void hda_codec_dev_unrealize(DeviceState *qdev) diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index f78c1833e341..8d710eee5d66 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -31,7 +31,7 @@ struct HDACodecBus { struct HDACodecDeviceClass { DeviceClass parent_class; =20 - int (*init)(HDACodecDevice *dev); + void (*init)(HDACodecDevice *dev, Error **errp); void (*exit)(HDACodecDevice *dev); void (*command)(HDACodecDevice *dev, uint32_t nid, uint32_t data); void (*stream)(HDACodecDevice *dev, uint32_t stnr, bool running, bool = output); --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875308939947.9583101235569; Mon, 25 Apr 2022 01:28:28 -0700 (PDT) Received: from localhost ([::1]:47338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niu55-0000zZ-NP for importer2@patchew.org; Mon, 25 Apr 2022 04:28:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu06-0006Uj-NL for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002f2-QP for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-3NzVTrl8OZGt-HCW4NULiw-1; Mon, 25 Apr 2022 04:22:04 -0400 Received: by mail-wr1-f70.google.com with SMTP id l11-20020adfc78b000000b0020abc1ce7e4so2424172wrg.1 for ; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id s2-20020adfa282000000b0020ad9c40555sm2790490wra.94.2022.04.25.01.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:02 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 23B7667B1B59; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LP+dkidDrA7cfJYHAisZQeWSrGU9PlpHAtpMlIl/SfU=; b=W2X4SkT9/CzP9Ljv4Et/cXO+X0Y3bcBkk5HS82pe8HatLJQ303SNCEUOdtnwL6ziky8t+p sT2ocww2LDe9UA76NCdetLX+9uAkTTUtW1eZb4irsvsn1l9iqHF0/AMUS+C1hqDPQD9tgI 4Ne5p/DbUUGHoJNvru3LY9cww8nr7TY= X-MC-Unique: 3NzVTrl8OZGt-HCW4NULiw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LP+dkidDrA7cfJYHAisZQeWSrGU9PlpHAtpMlIl/SfU=; b=WtPykElShU14/3s1gBk17dDYCmkLFMwQUx+Y9XouimehN5t1SzwKx3zq3ltPfLTEHC qPVfWRSR/3ivgLCgtwKq5bONfvPQvQHrnNfSdOyxzzDK4PO3aTvGBUoyB0U+GLVMj8er bRcfUSBB1WYnKEKGnPW5/v7YZtWYRLmLciFvO3eYPyJoR5YHDLR5opWLfDM5kC2Yecoo 0KzJAT7aWlqbIG2K4YFAdM09dV300tP+HlicFTrEzWG2bXycyzDNwI0gxLjwEqv0tQQa VLE+0fZ4WfdDfEGvqOVaMqyFqTI2xM3LdM1AUkshpZRH6TTb8XubB6iMPvnCzCJ5Dber OGTg== X-Gm-Message-State: AOAM531WgdaCgqoGkSPTe4v8awbhyWB36GzfBKqBYobxkwa4ql10+MDr dTwmnQep7IQLySzlkbZVVM1DIHesqdsTdOToTHEYbS/T5a70Q37IOp7fOV5SQtPHENLckeTqtCt 0Wf/rdc5VdStn+go= X-Received: by 2002:a7b:c155:0:b0:38e:b840:c99e with SMTP id z21-20020a7bc155000000b0038eb840c99emr24205908wmi.201.1650874923791; Mon, 25 Apr 2022 01:22:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF3yOmquu6AEfkG27LCAoxXCxRyK/bmeHLHRzKzd33HzQgGq5KPLwi+gafnv2wUQux0kat3w== X-Received: by 2002:a7b:c155:0:b0:38e:b840:c99e with SMTP id z21-20020a7bc155000000b0038eb840c99emr24205866wmi.201.1650874923491; Mon, 25 Apr 2022 01:22:03 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 04/18] hw/audio/lm4549: Add errp error reporting to init function Date: Mon, 25 Apr 2022 10:21:47 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875353207100001 Content-Type: text/plain; charset="utf-8" This will be used in future commit. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- hw/audio/lm4549.c | 3 ++- hw/audio/lm4549.h | 3 ++- hw/audio/pl041.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index 32b1481b5614..418041bc9c6c 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -276,7 +276,8 @@ static int lm4549_post_load(void *opaque, int version_i= d) return 0; } =20 -void lm4549_init(lm4549_state *s, lm4549_callback data_req_cb, void* opaqu= e) +void lm4549_init(lm4549_state *s, lm4549_callback data_req_cb, void* opaqu= e, + Error **errp) { struct audsettings as; =20 diff --git a/hw/audio/lm4549.h b/hw/audio/lm4549.h index aba9bb5b077c..61c3ab12dd33 100644 --- a/hw/audio/lm4549.h +++ b/hw/audio/lm4549.h @@ -36,7 +36,8 @@ typedef struct { extern const VMStateDescription vmstate_lm4549_state; =20 =20 -void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque); +void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque, + Error **errp); uint32_t lm4549_read(lm4549_state *s, hwaddr offset); void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value); uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t rig= ht); diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index 03acd4fe344b..868dffbfd321 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -564,7 +564,7 @@ static void pl041_realize(DeviceState *dev, Error **err= p) } =20 /* Init the codec */ - lm4549_init(&s->codec, &pl041_request_data, (void *)s); + lm4549_init(&s->codec, &pl041_request_data, (void *)s, errp); } =20 static const VMStateDescription vmstate_pl041_regfile =3D { --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650877380752157.8763093215415; Mon, 25 Apr 2022 02:03:00 -0700 (PDT) Received: from localhost ([::1]:36792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niucV-0007hL-TI for importer2@patchew.org; Mon, 25 Apr 2022 05:02:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0p-0007Hi-HH for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0n-0002qj-FF for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:03 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-3yt6W30-N8OvRT4UKBU43g-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f71.google.com with SMTP id h65-20020a1c2144000000b0038e9ce3b29cso9970920wmh.2 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id h9-20020a05600c350900b00393f01c8f00sm77266wmq.47.2022.04.25.01.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 2FFDE67B1B5A; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650875040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxH74JGUW7ryvtn4xS8i28T7ZhqNwBVbzuWMzVW6NKE=; b=HH5C9eQnhTmuP/XEUD6i8rOP2VueUriwqFEoPeJLsoOG0oy/9/SDMVMZ0ExBOfuTE/0H33 LU207QKQARjWA+ly6Auuz2qCtHU9Csa517bkj8/f5Lw57mTuCr0oa+XkKEjo2TalPA7bYf /DUgEc2G0fSp4CgVp4WTB/+a0Aos3vI= X-MC-Unique: 3yt6W30-N8OvRT4UKBU43g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CxH74JGUW7ryvtn4xS8i28T7ZhqNwBVbzuWMzVW6NKE=; b=pEcmCAmLVmTY0ih2mm9cqFtC6ASqLvNJbpYIUVV8cQkvXb/hPtE/ugV++CAGcbr6IR lrXJM6f27gc8xypwNEvbouGwDaYmtLHCNW1ZhiL0+pS3HT64auO6bAb/55QReLA7ZeDy YtH/68kTJhXe6PC+6q47HPaduWK1FYOOJG/j+DqYtUtqk6cYr6L1a7Dz70+SJPBI+gEr ILav5j5ucSe5lm73m6kntgYL89yRciM2jkiQRix1NtLfu4wfXHFsu/LDk91LkyQ8giiP 26n71Wg7wyqoff7B+VPBb5FcNsnrB3LwSXMafVaHTm5R0mpG2KCzpKtn/tpp4jstYnG/ 62Rg== X-Gm-Message-State: AOAM533eBS+GDpDXTElDPuX9QRTgK1Fb+G6LeIBbJLsZGCsvJGzZIkwM iVgLlT4fye5+J7TCFmEXSxRYErOFNzvYBrbszC7ZVkGdjRAGlu62Qi+11S4vnfbaLVXSq9by4Jv yohOq3Wu3dPyiKyM= X-Received: by 2002:a5d:598c:0:b0:20a:9194:22d4 with SMTP id n12-20020a5d598c000000b0020a919422d4mr13194369wri.124.1650874924651; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXaqOa3YGloOuHdu9I/QDfXPNlBvXS0NM2gTP8aPnZlIrHdCUbxL8fl4ZTH69w0ylU0Ngz2g== X-Received: by 2002:a5d:598c:0:b0:20a:9194:22d4 with SMTP id n12-20020a5d598c000000b0020a919422d4mr13194350wri.124.1650874924450; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 05/18] tests/qtest: Specify audiodev= and -audiodev Date: Mon, 25 Apr 2022 10:21:48 +0200 Message-Id: <6e7f2808dd40679a415812767b88f2a411fc137f.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650877382787100001 Content-Type: text/plain; charset="utf-8" This will enable removing deprecated default audiodev support. I did not figure out how to make the audiodev represented as an interface node, so this is a workaround. I am not sure what would be the proper way. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qtest/ac97-test.c | 3 ++- tests/qtest/es1370-test.c | 3 ++- tests/qtest/fuzz/generic_fuzz_configs.h | 6 ++++-- tests/qtest/intel-hda-test.c | 15 ++++++++++----- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/qtest/ac97-test.c b/tests/qtest/ac97-test.c index e09f2495d24d..9711f1f6d966 100644 --- a/tests/qtest/ac97-test.c +++ b/tests/qtest/ac97-test.c @@ -45,7 +45,8 @@ static void *ac97_create(void *pci_bus, QGuestAllocator *= alloc, void *addr) static void ac97_register_nodes(void) { QOSGraphEdgeOptions opts =3D { - .extra_device_opts =3D "addr=3D04.0", + .extra_device_opts =3D "addr=3D04.0,audiodev=3Daudio0", + .before_cmd_line =3D "-audiodev driver=3Dnone,id=3Daudio0", }; add_qpci_address(&opts, &(QPCIAddress) { .devfn =3D QPCI_DEVFN(4, 0) }= ); =20 diff --git a/tests/qtest/es1370-test.c b/tests/qtest/es1370-test.c index 2fd7fd2d3d30..5facda8d0d8d 100644 --- a/tests/qtest/es1370-test.c +++ b/tests/qtest/es1370-test.c @@ -46,7 +46,8 @@ static void *es1370_create(void *pci_bus, QGuestAllocator= *alloc, void *addr) static void es1370_register_nodes(void) { QOSGraphEdgeOptions opts =3D { - .extra_device_opts =3D "addr=3D04.0", + .extra_device_opts =3D "addr=3D04.0,audiodev=3Daudio0", + .before_cmd_line =3D "-audiodev driver=3Dnone,id=3Daudio0", }; add_qpci_address(&opts, &(QPCIAddress) { .devfn =3D QPCI_DEVFN(4, 0) }= ); =20 diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 004c701915e1..84a93b3c350b 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -101,8 +101,10 @@ const generic_fuzz_config predefined_configs[] =3D { },{ .name =3D "intel-hda", .args =3D "-machine q35 -nodefaults -device intel-hda,id=3Dhda0 " - "-device hda-output,bus=3Dhda0.0 -device hda-micro,bus=3Dhda0.0 " - "-device hda-duplex,bus=3Dhda0.0", + "-audiodev driver=3Dnone,id=3Daudio0", + "-device hda-output,bus=3Dhda0.0,audiodev=3Daudio0 " + "-device hda-micro,bus=3Dhda0.0,audiodev=3Daudio0 " + "-device hda-duplex,bus=3Dhda0.0,audiodev=3Daudio0", .objects =3D "intel-hda", },{ .name =3D "ide-hd", diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c index a58c98e4d11b..39ced2bc6ac6 100644 --- a/tests/qtest/intel-hda-test.c +++ b/tests/qtest/intel-hda-test.c @@ -11,20 +11,24 @@ #include "libqtest-single.h" =20 #define HDA_ID "hda0" -#define CODEC_DEVICES " -device hda-output,bus=3D" HDA_ID ".0" \ - " -device hda-micro,bus=3D" HDA_ID ".0" \ - " -device hda-duplex,bus=3D" HDA_ID ".0" +#define AUDIODEV " -audiodev driver=3Dnone,id=3Daudio0 " +#define AUDIODEV_REF "audiodev=3Daudio0" +#define CODEC_DEVICES " -device hda-output,bus=3D" HDA_ID ".0," AUDIODEV_R= EF \ + " -device hda-micro,bus=3D" HDA_ID ".0," AUDIODEV_RE= F \ + " -device hda-duplex,bus=3D" HDA_ID ".0," AUDIODEV_R= EF =20 /* Tests only initialization so far. TODO: Replace with functional tests */ static void ich6_test(void) { - qtest_start("-device intel-hda,id=3D" HDA_ID CODEC_DEVICES); + qtest_start(AUDIODEV "-device intel-hda,id=3D" HDA_ID CODEC_DEVICES); qtest_end(); } =20 static void ich9_test(void) { - qtest_start("-machine q35 -device ich9-intel-hda,bus=3Dpcie.0,addr=3D1= b.0,id=3D" + qtest_start("-machine q35" + AUDIODEV + "-device ich9-intel-hda,bus=3Dpcie.0,addr=3D1b.0,id=3D" HDA_ID CODEC_DEVICES); qtest_end(); } @@ -39,6 +43,7 @@ static void test_issue542_ich6(void) QTestState *s; =20 s =3D qtest_init("-nographic -nodefaults -M pc-q35-6.2 " + AUDIODEV "-device intel-hda,id=3D" HDA_ID CODEC_DEVICES); =20 qtest_outl(s, 0xcf8, 0x80000804); --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165087582051052.00224876269158; Mon, 25 Apr 2022 01:37:00 -0700 (PDT) Received: from localhost ([::1]:56148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuDB-0007GL-0g for importer2@patchew.org; Mon, 25 Apr 2022 04:36:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu03-0006TD-6P for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002ex-DZ for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:14 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-300-mQtdEsG8O2ajILQKGn5DcQ-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f72.google.com with SMTP id d6-20020a05600c34c600b0039296a2ac7cso6875586wmq.1 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id az20-20020a05600c601400b0038ffb253bb3sm12904265wmb.36.2022.04.25.01.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 31F3C67B1B5B; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/07G+KOnjwzPWs5gbVSF2lCzR4/Df0FQ6EC3Xytgne8=; b=D0SbXmk22P32dFepvZGi6TdCFU3cH5Ep6mKDpDkLxb2ubKEHPm8E61wg3lGaE4lp1a5R21 0DTQCirRlM+E62SMdS2bWpvEtCwlnpFl5CzVcxa9t6eEGSKFfFezstbQIX0zu/FnSWzPKB q07MfNBw/50UJ8L4bLwpiaFSim+c5Mw= X-MC-Unique: mQtdEsG8O2ajILQKGn5DcQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/07G+KOnjwzPWs5gbVSF2lCzR4/Df0FQ6EC3Xytgne8=; b=z7aQpdkWH4XfJnyT29zmIVnTvIfxTrUNVIJPtMaiGd2iC8iio8JqaQJSD8BjoGzhgR oRqV7w2LIlUROx6D4gg4bi92vkLU2/WKg0J05BMBipCROBKcUBsml8IgppcOXUMVjB9a Dd/BVjmoZcHeBpExuu20FzLC9smsKmG933QjN4/Dm/CWahyOYE2AXQZ+s1KGdz17B6yt T8kI56On3fTu5uquWNgsIsPIY81Xy+48cQ5MZxfcBGMKu3SOGAb18JaK99xhVk+Qpnmj KcMCKPEvwCMkKsJALpLMcEDFqIY4kTqCyFH8utLQiRkiLy+0LKCRDwFCzgog0LdawPw+ xbYA== X-Gm-Message-State: AOAM533r9cIFGNDgb67U3pEq3Ym+VhGvz3n6LComijxVB49kSLIex1Qi rg3U2tTPJk2V7TzPj3KBlSaBNQSCSLPxEwDqaxJ2x6i/cZItNgbX5sOXSAxL+rL8zhefohsoOaO jz47dKeoqtZZhbYg= X-Received: by 2002:a05:600c:3b97:b0:393:ea66:77ef with SMTP id n23-20020a05600c3b9700b00393ea6677efmr5295096wms.120.1650874924770; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwVF3dK0i9vOzAY/PYvnp5i5lQER5yvkUNth9GcfEFLwk+oH+Lrsa2v9IyXQkqINxFUFcY9g== X-Received: by 2002:a05:600c:3b97:b0:393:ea66:77ef with SMTP id n23-20020a05600c3b9700b00393ea6677efmr5295078wms.120.1650874924601; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 06/18] ui/vnc: Require audiodev= Date: Mon, 25 Apr 2022 10:21:49 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875822274100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- ui/vnc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index badf1d7664fe..2e7af139b030 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -4188,12 +4188,15 @@ void vnc_display_open(const char *id, Error **errp) vd->ledstate =3D 0; =20 audiodev =3D qemu_opt_get(opts, "audiodev"); - if (audiodev) { - vd->audio_state =3D audio_state_by_name(audiodev); - if (!vd->audio_state) { - error_setg(errp, "Audiodev '%s' not found", audiodev); - goto fail; - } + if (!audiodev) { + error_setg(errp, "Audiodev parameter for vnc required"); + goto fail; + } + + vd->audio_state =3D audio_state_by_name(audiodev); + if (!vd->audio_state) { + error_setg(errp, "Audiodev '%s' not found", audiodev); + goto fail; } =20 device_id =3D qemu_opt_get(opts, "display"); --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876221346520.9161451288156; Mon, 25 Apr 2022 01:43:41 -0700 (PDT) Received: from localhost ([::1]:36768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuJo-000536-84 for importer2@patchew.org; Mon, 25 Apr 2022 04:43:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu08-0006V5-2G for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu03-0002gU-8n for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:19 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-jisiurINOx-zymX68PMyXQ-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f72.google.com with SMTP id l7-20020adfbd87000000b0020ac0a4d23dso2389288wrh.17 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g13-20020a05600c4ecd00b00393ec8be5cfsm1755054wmq.24.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 3F2DC67B1B5C; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=cIkucddEBbYJaLLYHnt96ElDY1qprhm8qXvpPbFL4Qqlv2iEcRcE527oEx/ZlXAfOz0udJ aSbmTy+dGDMH6DJWqlBUY3oTb2ztLXB2S0M98iSQzfEW7eGtg6upOaFAHU1Zg0/9GpIolF FHGpkBTRALSQUJC9/ksxqNEMsuUtdm8= X-MC-Unique: jisiurINOx-zymX68PMyXQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=DpC2u4sNdyLLs8xPc/hQsasKRj8YzhdOwyp5QbjyreeMV8wNU86uFRe0sya+ZxEaHa mb57aQHkZJaZ1lhC9q/dF+icpKEQAelwRYyvxeo+LpRh0WszZuZS9hZcBqGZ7EZCmv9D 3qhSAipy1zztuh+i5b1QkTXMiXtkzBjcq2/HUlQf0cqfpVR7SmJyWycSvdRTmW8Gq5zs gdV71UCBMrAa6wOS47ODo6qEN7+doDflHk8RJkcKbdt0iqRdMhje4RJkFuppOW7aVsTP HGLRFbvPjBfHhuKuCBA+Rq7HF3QM6bJPq3CtLLA4nvZHlrhMOt4hhldCehnYKHD3wPul qhkQ== X-Gm-Message-State: AOAM531frBFnfryKFPvBNNai2pX3z3U7OJtkNcmT+X26xjwoz684fShg +MDiyxkrv2SFQ3XjmbaikoVRHe0ORQ7KPUeG37UKQhLXnIekig1f8ftApYYwQzA9Rmi8mV6J/lp AD4sALg4+OQsjbTM= X-Received: by 2002:a7b:c8d5:0:b0:392:b12e:fd11 with SMTP id f21-20020a7bc8d5000000b00392b12efd11mr15517517wml.96.1650874925077; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUahLQt6GhA+0msQeYylE6Fv6b6MYTVsGx0uQ2lBLi4J52QheCVTnDPzDtU109D1faST8FXQ== X-Received: by 2002:a7b:c8d5:0:b0:392:b12e:fd11 with SMTP id f21-20020a7bc8d5000000b00392b12efd11mr15517503wml.96.1650874924883; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 07/18] Introduce machine's default-audiodev property Date: Mon, 25 Apr 2022 10:21:50 +0200 Message-Id: <49192ccd62fc98c474bb0b627a22cc28a634e8b8.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876222706100001 Content-Type: text/plain; charset="utf-8" Many machine types have default audio devices with no way to set the underl= ying audiodev. Instead of adding an option for each and every one of them this = new property can be used as a default during machine initialisation when creati= ng such devices. Signed-off-by: Martin Kletzander --- hw/core/machine.c | 23 +++++++++++++++++++++++ include/hw/boards.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index cb9bbc844d24..d055a126d398 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -596,6 +596,22 @@ static void machine_set_memdev(Object *obj, const char= *value, Error **errp) ms->ram_memdev_id =3D g_strdup(value); } =20 +static char *machine_get_default_audiodev(Object *obj, Error **errp) +{ + MachineState *ms =3D MACHINE(obj); + + return g_strdup(ms->default_audiodev); +} + +static void machine_set_default_audiodev(Object *obj, const char *value, + Error **errp) +{ + MachineState *ms =3D MACHINE(obj); + + g_free(ms->default_audiodev); + ms->default_audiodev =3D g_strdup(value); +} + HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine) { int i; @@ -867,6 +883,12 @@ static void machine_class_init(ObjectClass *oc, void *= data) object_class_property_set_description(oc, "confidential-guest-support", "Set confidential guest scheme t= o support"); =20 + object_class_property_add_str(oc, "default-audiodev", + machine_get_default_audiodev, + machine_set_default_audiodev); + object_class_property_set_description(oc, "default-audiodev", + "Audiodev to use for default mac= hine devices"); + /* For compatibility */ object_class_property_add_str(oc, "memory-encryption", machine_get_memory_encryption, machine_set_memory_encryption); @@ -961,6 +983,7 @@ static void machine_finalize(Object *obj) g_free(ms->device_memory); g_free(ms->nvdimms_state); g_free(ms->numa_state); + g_free(ms->default_audiodev); } =20 bool machine_usb(MachineState *machine) diff --git a/include/hw/boards.h b/include/hw/boards.h index d64b5481e834..5be1de50af03 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -346,6 +346,7 @@ struct MachineState { */ MemoryRegion *ram; DeviceMemoryState *device_memory; + char *default_audiodev; =20 ram_addr_t ram_size; ram_addr_t maxram_size; --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876225591931.2025789233123; Mon, 25 Apr 2022 01:43:45 -0700 (PDT) Received: from localhost ([::1]:36982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuJs-0005BW-Fb for importer2@patchew.org; Mon, 25 Apr 2022 04:43:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu06-0006UM-4p for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002fN-PY for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:17 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-0UY_C6VnMN2ClcYZDI0MJQ-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wm1-f72.google.com with SMTP id az27-20020a05600c601b00b0038ff021c8a4so9975318wmb.1 for ; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g13-20020a5d64ed000000b0020a9e488976sm8952474wri.25.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 40E2E67B1B5D; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PAZUwc5ZqVj8eUHH2Oe1Tiz0RIqORJb8+QvvQ1BqMLI=; b=jAYYJXBGl122yd0XGTPw9V7yOwWFSd5E7izCyvYir/FWPma+Nm5ckxdHax2kvHLWLf5uRC RsftVp0oq/v/Ol+4dP0AfYfIJ1Rr2fcuhgFuHfnUNm8wHCw+OVN4j5Pc0nHzz8BV0mzbCZ wgVUYB0iVl4hjKq0sZZgERDHXT55UHQ= X-MC-Unique: 0UY_C6VnMN2ClcYZDI0MJQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PAZUwc5ZqVj8eUHH2Oe1Tiz0RIqORJb8+QvvQ1BqMLI=; b=5cHvV5n2817EDUTC8Xne/dDUB1Qjqb2IslrErDXQHpX2Bdwj9DbxP25YArEDG/p87y QAMAK1UH67UQ60MnbBHRa0Q0ozHk+KNePEGe0YPlPikUHWlKC8JR4jOIWAKQ/SoC8DR+ VAeC9jIruSitHiAYWB+p4uhRHgaWWHlNvy4ag3GXads9RE59N95HPigHsY+lU9e/r1fE Gd5v8uxYYc06bi3YXJ4jcNJlwx05Z+67jHG63eXebrNdBJqPYlDe0GwtXKVOvCxLcDZ5 Y7ahniiSOj1pc2/IXY5hsLqU7RYT6mbTgf6ZbIY3U43tTmGo5YN3cUUDPHd4TsXr/BoQ RMPA== X-Gm-Message-State: AOAM533Z84RuRkY/quADWVDCzesLioF/G6NnTVqNFZCl7NmR42tp6R+q 9S8D/2IE75L6N1HsVgn5DiRF0P0/RG+ZfMdkWS4uwSx3ZfUDR3u+fr/EPk91z/dGu5trf4PUDiu qW1UiSKJUXeWZb4I= X-Received: by 2002:a5d:47a4:0:b0:20a:c95e:b3f3 with SMTP id 4-20020a5d47a4000000b0020ac95eb3f3mr12086549wrb.663.1650874924928; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9AN3DTpD4mNyWicCScIo/ePV7PEwSCtTlMYdcy2N7R8rIsAaI7dxGdpvi0OKSlN4jAW/JFA== X-Received: by 2002:a5d:47a4:0:b0:20a:c95e:b3f3 with SMTP id 4-20020a5d47a4000000b0020ac95eb3f3mr12086529wrb.663.1650874924731; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 08/18] audio: Add easy dummy audio initialiser Date: Mon, 25 Apr 2022 10:21:51 +0200 Message-Id: <7b0a067b8b0a32ef7ec7c040d1e79d40a9a6b0de.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876227179100001 Content-Type: text/plain; charset="utf-8" In case of sound devices which are created by default (some of them even wi= th -nodefaults) it would not be nice to users if qemu required explicit: -audiodev driver=3Dnone,id=3Daudio0 -machine default-audiodev=3Daudio0 when they just want to run a VM and not care about any audio output. Inste= ad this little helper makes it easy to create a dummy audiodev (driver=3Dnone)= in case there is no default-audiodev specified for the machine. To make sure = users are not surprised by no sound output a helping message is also printed out. Signed-off-by: Martin Kletzander --- audio/audio.c | 34 ++++++++++++++++++++++++++++++++++ audio/audio.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 9e91a5a4f2b8..671845c65d18 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -37,6 +37,7 @@ #include "sysemu/runstate.h" #include "ui/qemu-spice.h" #include "trace.h" +#include "hw/boards.h" =20 #define AUDIO_CAP "audio" #include "audio_int.h" @@ -2122,6 +2123,39 @@ void audio_init_audiodevs(void) } } =20 +static void audio_init_dummy(const char *id) +{ + Audiodev *dev =3D g_new0(Audiodev, 1); + AudiodevListEntry *e =3D g_new0(AudiodevListEntry, 1); + + dev->driver =3D AUDIODEV_DRIVER_NONE; + dev->id =3D g_strdup(id); + + audio_validate_opts(dev, &error_abort); + audio_init(dev, NULL); + + e->dev =3D dev; + QSIMPLEQ_INSERT_TAIL(&audiodevs, e, next); +} + +const char *audio_maybe_init_dummy(const char *default_id) +{ + MachineState *ms =3D MACHINE(qdev_get_machine()); + + if (ms->default_audiodev) { + return ms->default_audiodev; + } + + dolog("warning: No audiodev specified for implicit machine devices, " + "no audio output will be available for these. " + "For setting a backend audiodev for such devices try using " + "the default-audiodev machine option.\n"); + + audio_init_dummy(default_id); + + return default_id; +} + audsettings audiodev_to_audsettings(AudiodevPerDirectionOptions *pdo) { return (audsettings) { diff --git a/audio/audio.h b/audio/audio.h index 3d5ecdecd5c1..335704a4ddb1 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -175,6 +175,8 @@ void audio_legacy_help(void); AudioState *audio_state_by_name(const char *name); const char *audio_get_id(QEMUSoundCard *card); =20 +const char *audio_maybe_init_dummy(const char *default_id); + #define DEFINE_AUDIO_PROPERTIES(_s, _f) \ DEFINE_PROP_AUDIODEV("audiodev", _s, _f) =20 --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875961785337.81908462130764; Mon, 25 Apr 2022 01:39:21 -0700 (PDT) Received: from localhost ([::1]:59410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuFW-00019u-A5 for importer2@patchew.org; Mon, 25 Apr 2022 04:39:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0B-0006am-Ja for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:59037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu04-0002hJ-Lc for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:23 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-356-37EaWVsUPfSusEPoxx2Hng-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f71.google.com with SMTP id s14-20020adfa28e000000b0020ac7532f08so1766541wra.15 for ; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id e9-20020a056000178900b0020a9f995a3csm8466324wrg.24.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 4D44467B1B5E; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gedXaEU9mdSzLcQUY6OVe9Xoeu9dbw5uLfUiFLxMZHc=; b=QplVIMD0JjH8T+FGu6+Q8ozaqnyYcz/yvg4IbvFYo8phlm4gSdG0Ne8UOEq+Y5cyzm3wkF hfFPugtMtdUMNmuMg5/L7fAH7/ZJ+OX2b9R5ytiWZqGChSDvZ5kkvzQfu+LAEcQCDvoRUw /r9N0eQl1ScCBzNg11KrObhbwcU2hyE= X-MC-Unique: 37EaWVsUPfSusEPoxx2Hng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gedXaEU9mdSzLcQUY6OVe9Xoeu9dbw5uLfUiFLxMZHc=; b=NCo8vIUiCPjJauPJ5OtFyFaloKTNqn7iUO1KYKsiagIwHc6yMdcGU4yUggJmMdE2tG oOB1h2diOQSuSIgz7EFhKIFV5ye/YHdKj7dUv05h0dn8pN4nEUzdQxsFnfkIJdCzDcZD lRrjK+e9GinNWawdL+q2q849VgAmgunUnLjYgMY7c7MyRtk6Wz0+7OV2aYQhlhq3Pk1D 3WWaU09B8hbeHIpOq/HhPthIOSl6zKWdqUezjQIdAruTXq7fwEDRVU4+IGWb9Jaw3gKP UtHTGLXKVIZEuHwAoLnM4Wps9DGNT7z2UEFgfKwDIz/eKRWOLsNtn2FJpAqPQFJSHxPm Ne+A== X-Gm-Message-State: AOAM532RLkw3L9BL4o34DkMBcIJLjPUOentQWNVGaJstuqFQp1vS280z xRb7d7aj3Ewmim6iPBwY3YPdgqWivgyGSzMHPz3sXlUEAe1ucj4BOpkSVb/4ajxOkFHHSUeA95+ 0k6w4ZPV1DK5VFdY= X-Received: by 2002:a5d:64e4:0:b0:20a:e005:cc96 with SMTP id g4-20020a5d64e4000000b0020ae005cc96mr708538wri.402.1650874925637; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvgkO0CivWwDJyQNO38wTOSZhz/sNkJZgmhGnuOhQaqju/u9/FUPpSUw0KbbYEt3haVP9WCA== X-Received: by 2002:a5d:64e4:0:b0:20a:e005:cc96 with SMTP id g4-20020a5d64e4000000b0020ae005cc96mr708518wri.402.1650874925442; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 09/18] hw/display/xlnx_dp.c: Add audiodev property Date: Mon, 25 Apr 2022 10:21:52 +0200 Message-Id: <16963256573fcbfa7720aa2fd000ba74a4055222.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875962624100001 Content-Type: text/plain; charset="utf-8" There was no way to set this and we need that for it to be able to properly initialise. Signed-off-by: Martin Kletzander --- hw/display/xlnx_dp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 9bb781e31254..b16d6be2b5cc 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1357,6 +1357,11 @@ static void xlnx_dp_reset(DeviceState *dev) xlnx_dp_update_irq(s); } =20 +static Property xlnx_dp_device_properties[] =3D { + DEFINE_AUDIO_PROPERTIES(XlnxDPState, aud_card), + DEFINE_PROP_END_OF_LIST(), +}; + static void xlnx_dp_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); @@ -1364,6 +1369,7 @@ static void xlnx_dp_class_init(ObjectClass *oc, void = *data) dc->realize =3D xlnx_dp_realize; dc->vmsd =3D &vmstate_dp; dc->reset =3D xlnx_dp_reset; + device_class_set_props(dc, xlnx_dp_device_properties); } =20 static const TypeInfo xlnx_dp_info =3D { --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876812245879.8127073661543; Mon, 25 Apr 2022 01:53:32 -0700 (PDT) Received: from localhost ([::1]:52486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuTL-0007De-8o for importer2@patchew.org; Mon, 25 Apr 2022 04:53:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu09-0006W8-H9 for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu04-0002h6-Eu for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:21 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-73-JB4t6AnTNt-X2zfiR6q5oQ-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wm1-f72.google.com with SMTP id i66-20020a1c3b45000000b0038eab4e0feaso6451929wma.9 for ; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id d6-20020a5d5386000000b0020a79c74bedsm8138594wrv.79.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 4EDAE67B1B5F; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u73kz9B6wJ0lq4eD98kOBj7vDwMC85uO0URBzEu5tl8=; b=GeHAeYS62WVWVUA2VMN0rfxETT67hqkldbWJd505bjpET3fBV8C86szc9i++nRwz/VL+v4 cr1/mTUzP6EkL8UC9cNnXobn9rsUukOyLq+WJcN+56hU9UjLv/LtrfYXS7VCz1K2JdBV6H cWEWopm5s9rqP+u6q1PR0vDGCBj2aog= X-MC-Unique: JB4t6AnTNt-X2zfiR6q5oQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u73kz9B6wJ0lq4eD98kOBj7vDwMC85uO0URBzEu5tl8=; b=GoCdWPmyxKUgDFdqJWRUffwgcjvtcUyk4RVT4s/d7FJzduhelP8j4/mxIBUspRBKWi +f4kcYVa+/SCVL97dtFiHd2bOtpxv7oUr9yNwSP6MuNLuiLamQxv+Lv46J7ivpQHwYLQ mAVueww53yHeXH0eSJQOWbQ9vj58qrazMbRijggH4ecm4V1K9Yfw72ktWe9Q+SvPHnkA xu6YRHnwo0hkkbD3ay0TRC5WxfEeOkkpnVu6f0GGlzWMyXewPquDWvsm9bqCKzjn9CXQ tp0W51yrM+CRfYErdf5npMhSXIIcq5ojPmfX6JSl8HA9ItdhZXvb8SeIxLEhs61NJ7J2 fSXA== X-Gm-Message-State: AOAM531Xlu0WW6DBzx5mDLZbz85lY5Q/3riwfR8oy40rG78GwI6rmFLQ +eCMGLv8Epl+o2/BEzi6kV8nSJc5WaAfuUhjL9Xu8YrG8ilyEoHxrIRkqTEXMm756yMweKEBN10 7Qs0OYS/l3VEVNMQ= X-Received: by 2002:a5d:50c4:0:b0:20a:c547:454a with SMTP id f4-20020a5d50c4000000b0020ac547454amr13706719wrt.16.1650874925383; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw0bKELAkGu9TNA01Os1ZFg2LxKt8OV9BWwBE3Cl1xW/eNTb5Mc+/9jUvoF2QleRh8GiV/AA== X-Received: by 2002:a5d:50c4:0:b0:20a:c547:454a with SMTP id f4-20020a5d50c4000000b0020ac547454amr13706690wrt.16.1650874925184; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 10/18] hw/input/tsc210x.c: Support machine-default audiodev with fallback Date: Mon, 25 Apr 2022 10:21:53 +0200 Message-Id: <0b13f27f5389d0a75b9e3046830f88fd37de54f2.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876821511100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- hw/input/tsc210x.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index f16a8090b7c7..f0b02bc72280 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -1098,6 +1098,14 @@ static void tsc210x_init(TSC210xState *s, =20 qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, name); =20 + const char *audiodev_id =3D audio_maybe_init_dummy("tsc.defaudio"); + s->card.name =3D g_strdup(audiodev_id); + s->card.state =3D audio_state_by_name(s->card.name); + if (!s->card.state) { + error_setg(&error_fatal, "Cannot find audiodev with id '%s'", + s->card.name); + } + AUD_register_card(s->name, &s->card); =20 qemu_register_reset((void *) tsc210x_reset, s); --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650877056196132.94162825146088; Mon, 25 Apr 2022 01:57:36 -0700 (PDT) Received: from localhost ([::1]:60150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuXH-00048Y-3Z for importer2@patchew.org; Mon, 25 Apr 2022 04:57:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0B-0006aF-Db for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu04-0002h9-Jr for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:22 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-WnaiqzQPO-KTKV8yZNXCsg-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wm1-f72.google.com with SMTP id g13-20020a1c4e0d000000b0038eba16aa46so6862127wmh.7 for ; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id f14-20020a0560001a8e00b0020aaf034e59sm10200944wry.90.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 5B24167B1B60; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=XpKMl5VjfeBMX7Idi7sw8JpiEdekYiue7fHf1nfBrlgsELeEM6SdFsHOlBAfRoVWlAUb2k Sz/ktDaIqN3UH06dgr+woUYULSa01bU3tpS5uQFjuGoZlb30PF4UjMa7+SEMt4szkH4vI6 IWNcueDA11BDj52FeadD2ilKepVE8T0= X-MC-Unique: WnaiqzQPO-KTKV8yZNXCsg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=SMS6iBFtWoIAzjMCy4bE8HPu+hxWHCQL7tYfVCraUUFaSoOGm/HoTIRtxE/E+OXQzW 19ZrT3LpEMdeHAbBU+gy4u7rCE4/WvY7Y/eCaX/Oct5N5FZnDy1iTzFoQDpK/aW6Krh6 MRdTGeNVC7Gv94tEZpUr0iKFSdlyvzVB44fYuRcPtKoOivouJvrz1GRaKMCwrN+N1SMT PgRY1pzDw6T8gvNgL7ftTqBeg22lx8x9o9F05GzhhDeXDa8/PZlitzQWkOpbXRzcXUeH H7F35gZrlwgresDBo4dMe71stMuFrglEZVRoZQT3XSuEJUS8LB6d5SevAOiL1C4A0d9M 7ILA== X-Gm-Message-State: AOAM5329biz3Hersa2xKEDpTVN5IEKq+IJsjqWfwLi7qOmhBxfymSHuo EiF1PZRQjGb5/6ZNWkAESnSIojA1h9d3fewGv/+Sd5F/lt65RMO15SiZF25ShQMiFSMoLMFV1p+ yeP5NZPk2CuAV2dY= X-Received: by 2002:a05:600c:1f0f:b0:38e:c9c8:9983 with SMTP id bd15-20020a05600c1f0f00b0038ec9c89983mr15260376wmb.105.1650874925592; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfD48BjcAECR06YOf9cPKRyTCroqPF2jgrk5q5uvbVqvWjFeT6iIsEtGTyaM6j9J+f1w4xow== X-Received: by 2002:a05:600c:1f0f:b0:38e:c9c8:9983 with SMTP id bd15-20020a05600c1f0f00b0038ec9c89983mr15260357wmb.105.1650874925311; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 11/18] hw/arm: Support machine-default audiodev with fallback Date: Mon, 25 Apr 2022 10:21:54 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650877057202100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- hw/arm/integratorcp.c | 8 +++++++- hw/arm/musicpal.c | 8 +++++++- hw/arm/omap2.c | 8 ++++++++ hw/arm/realview.c | 3 +++ hw/arm/spitz.c | 10 +++++++--- hw/arm/versatilepb.c | 3 +++ hw/arm/vexpress.c | 3 +++ hw/arm/xlnx-zcu102.c | 4 ++++ hw/arm/z2.c | 12 +++++++++++- 9 files changed, 53 insertions(+), 6 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index b109ece3ae02..0a6d4186dad6 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -27,6 +27,7 @@ #include "hw/irq.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" OBJECT_DECLARE_SIMPLE_TYPE(IntegratorCMState, INTEGRATOR_CM) @@ -660,7 +661,12 @@ static void integratorcp_init(MachineState *machine) &error_fatal); } =20 - sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL); + dev =3D qdev_new("pl041"); + qdev_prop_set_string(dev, "audiodev", + audio_maybe_init_dummy("integrator.defaudio")); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x1d000000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[25]); =20 if (nd_table[0].used) smc91c111_init(&nd_table[0], 0xc8000000, pic[27]); diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 7c840fb4283e..5d53ed3a8709 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -35,6 +35,7 @@ #include "qemu/cutils.h" #include "qom/object.h" #include "hw/net/mv88w8618_eth.h" +#include "audio/audio.h" =20 #define MP_MISC_BASE 0x80002000 #define MP_MISC_SIZE 0x00001000 @@ -1324,7 +1325,12 @@ static void musicpal_init(MachineState *machine) qdev_connect_gpio_out(key_dev, i, qdev_get_gpio_in(dev, i + 15)); } =20 - wm8750_dev =3D i2c_slave_create_simple(i2c, TYPE_WM8750, MP_WM_ADDR); + wm8750_dev =3D i2c_slave_new(TYPE_WM8750, MP_WM_ADDR); + + qdev_prop_set_string(DEVICE(wm8750_dev), "audiodev", + audio_maybe_init_dummy("musicpal.defaudio")); + i2c_slave_realize_and_unref(wm8750_dev, i2c, &error_abort); + dev =3D qdev_new(TYPE_MV88W8618_AUDIO); s =3D SYS_BUS_DEVICE(dev); object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev), diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 02b1aa8c974b..4ae524a1a1a6 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -604,12 +604,20 @@ static struct omap_eac_s *omap_eac_init(struct omap_t= arget_agent_s *ta, qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk) { struct omap_eac_s *s =3D g_new0(struct omap_eac_s, 1); + const char *audiodev_id =3D audio_maybe_init_dummy("eac.defaudio"); =20 s->irq =3D irq; s->codec.rxdrq =3D *drq ++; s->codec.txdrq =3D *drq; omap_eac_reset(s); =20 + s->codec.card.name =3D g_strdup(audiodev_id); + s->codec.card.state =3D audio_state_by_name(s->codec.card.name); + if (!s->codec.card.state) { + error_setg(&error_fatal, "Cannot find audiodev with id '%s'", + s->codec.card.name); + } + AUD_register_card("OMAP EAC", &s->codec.card); =20 memory_region_init_io(&s->iomem, NULL, &omap_eac_ops, s, "omap.eac", diff --git a/hw/arm/realview.c b/hw/arm/realview.c index d2dc8a895258..4fcdd821789a 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -29,6 +29,7 @@ #include "hw/irq.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" +#include "audio/audio.h" =20 #define SMP_BOOT_ADDR 0xe0000000 #define SMP_BOOTREG_ADDR 0x10000030 @@ -207,6 +208,8 @@ static void realview_init(MachineState *machine, =20 pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("realview.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, 0x10004000); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, pic[19]); diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 5aab0b856574..94fff2f460ca 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -35,6 +35,7 @@ #include "exec/address-spaces.h" #include "cpu.h" #include "qom/object.h" +#include "audio/audio.h" =20 enum spitz_model_e { spitz, akita, borzoi, terrier }; =20 @@ -779,10 +780,13 @@ static void spitz_i2c_setup(PXA2xxState *cpu) /* Attach the CPU on one end of our I2C bus. */ I2CBus *bus =3D pxa2xx_i2c_bus(cpu->i2c[0]); =20 - DeviceState *wm; - /* Attach a WM8750 to the bus */ - wm =3D DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0)); + I2CSlave *i2c_dev =3D i2c_slave_new(TYPE_WM8750, 0); + DeviceState *wm =3D DEVICE(i2c_dev); + + qdev_prop_set_string(wm, "audiodev", + audio_maybe_init_dummy("spitz.defaudio")); + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); =20 spitz_wm8750_addr(wm, 0, 0); qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM, diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index ecc1f6cf74ff..e068f592b134 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -26,6 +26,7 @@ #include "hw/char/pl011.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define VERSATILE_FLASH_ADDR 0x34000000 #define VERSATILE_FLASH_SIZE (64 * 1024 * 1024) @@ -343,6 +344,8 @@ static void versatile_init(MachineState *machine, int b= oard_id) /* Add PL041 AACI Interface to the LM4549 codec */ pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("versatilepb.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, 0x10004000); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, sic[24]); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e1d1983ae657..f312a4d5315e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -44,6 +44,7 @@ #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define VEXPRESS_BOARD_ID 0x8e0 #define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024) @@ -614,6 +615,8 @@ static void vexpress_common_init(MachineState *machine) =20 pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("vexpress.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, map[VE_PL041]); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, pic[11]); diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 4c84bb932aa0..e4c32e158b61 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -24,6 +24,7 @@ #include "sysemu/device_tree.h" #include "qom/object.h" #include "net/can_emu.h" +#include "audio/audio.h" =20 struct XlnxZCU102 { MachineState parent_obj; @@ -143,6 +144,9 @@ static void xlnx_zcu102_init(MachineState *machine) =20 object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_XLNX_ZYN= QMP); =20 + qdev_prop_set_string(DEVICE(&s->soc.dp), "audiodev", + audio_maybe_init_dummy("zcu102.defaudio")); + object_property_set_link(OBJECT(&s->soc), "ddr-ram", OBJECT(machine->r= am), &error_abort); object_property_set_bool(OBJECT(&s->soc), "secure", s->secure, diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9c1e876207b3..8d9141998870 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -26,6 +26,7 @@ #include "exec/address-spaces.h" #include "cpu.h" #include "qom/object.h" +#include "qapi/error.h" =20 #ifdef DEBUG_Z2 #define DPRINTF(fmt, ...) \ @@ -306,6 +307,7 @@ static void z2_init(MachineState *machine) void *z2_lcd; I2CBus *bus; DeviceState *wm; + I2CSlave *i2c_dev; =20 /* Setup CPU & memory */ mpu =3D pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu= _type); @@ -330,8 +332,16 @@ static void z2_init(MachineState *machine) type_register_static(&aer915_info); z2_lcd =3D ssi_create_peripheral(mpu->ssp[1], TYPE_ZIPIT_LCD); bus =3D pxa2xx_i2c_bus(mpu->i2c[0]); + i2c_slave_create_simple(bus, TYPE_AER915, 0x55); - wm =3D DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0x1b)); + + i2c_dev =3D i2c_slave_new(TYPE_WM8750, 0x1b); + wm =3D DEVICE(i2c_dev); + + qdev_prop_set_string(wm, "audiodev", + audio_maybe_init_dummy("z2.defaudio")); + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); + mpu->i2s->opaque =3D wm; mpu->i2s->codec_out =3D wm8750_dac_dat; mpu->i2s->codec_in =3D wm8750_adc_dat; --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650877375858574.108550812746; Mon, 25 Apr 2022 02:02:55 -0700 (PDT) Received: from localhost ([::1]:36552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niucR-0007TW-2b for importer2@patchew.org; Mon, 25 Apr 2022 05:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0C-0006cu-IC for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu04-0002hH-ML for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:24 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-4xOGewTgNxSelzXytBFgYQ-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wr1-f69.google.com with SMTP id p18-20020adf9592000000b00207bc12decbso3072211wrp.21 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id v6-20020a056000144600b0020a9a1627e2sm8374495wrx.15.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 6890067B1B61; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bwBj2TaBRASZZSGjsc9HqXLMt7MyjxjnAoNllDw6MNM=; b=ivDUtsSj4RGYuO5Jr2+pwV45Ad6aeEGWZrHVmMdm/hN3cOJKuuaphJjV9pPUM9ncaZ8GAo U/nOxGN1Hpuqpf/EpeU5hWc5eqcjmbB95lKxMld5I1EVq6ahdcXMwpvn+5zqF471a3VzJq 7RuBmLNwS+CK1MI6FBK+exmPipkc7zg= X-MC-Unique: 4xOGewTgNxSelzXytBFgYQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bwBj2TaBRASZZSGjsc9HqXLMt7MyjxjnAoNllDw6MNM=; b=0DJSR5sNsfzAVpW7G6E6H2REufVbLdOAf0Wo5Q38YF+aH4YffbgqhBt+zqg4r9q+bb qBGZd9uLyAjy8PgWYXpWwMHvy0D06e6FTHrDRe9mCS5Nvl3iHCzjE2FXZyHSwBvveSc2 1msMSsJC/9rBRg/ZELgocPj8XOdRv8uX1IxN16WvkBNhJEB4aylTAkRiAqcxF0dQKDa6 ZoHXgKcQ1pUcdmqiMnkybh3Z8i9W2+7IkZx+zJ5FWmKobhAJhixE8PrPFZwPjJU9KJjy xvDzZ18jUAI6a3btp29VeL2f1K4phZ4vAKKhnfQCq2o38AiqoSq+3KnhihpNhl8VogV7 wfIA== X-Gm-Message-State: AOAM533wBmwQPdOV+OnSwCZBaAQJuVpATreZ7PcOlQKOEMTAc9oo43F7 b26LRHknP3R6dTuveRdneFs+pMLuNaTTLyDaUSQSO+DIx7oSGOb/EijwAptjAYqi6Jq0kE2UOGK ocL/pelMmKRR3qOI= X-Received: by 2002:a05:6000:1686:b0:20a:96e0:9bbe with SMTP id y6-20020a056000168600b0020a96e09bbemr13086396wrd.635.1650874926176; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw86C2gO2mMfKjeVrOKrDA/Qz/F6XRAJwprg6q1Fd+mFJa4HUgm+acUIsw2U/W4vncKhcrY0w== X-Received: by 2002:a05:6000:1686:b0:20a:96e0:9bbe with SMTP id y6-20020a056000168600b0020a96e09bbemr13086362wrd.635.1650874925990; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 12/18] hw/ppc: Support machine-default audiodev with fallback Date: Mon, 25 Apr 2022 10:21:55 +0200 Message-Id: <9e9864dfe1cea988e7fdca14a1425d80e5895094.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650877384763100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- hw/ppc/prep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index bf622aa38fab..52d801afb307 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -46,6 +46,7 @@ #include "elf.h" #include "qemu/units.h" #include "kvm_ppc.h" +#include "audio/audio.h" =20 /* SMP is not enabled, for now */ #define MAX_CPUS 1 @@ -304,6 +305,9 @@ static void ibm_40p_init(MachineState *machine) dev =3D DEVICE(isa_dev); qdev_prop_set_uint32(dev, "iobase", 0x830); qdev_prop_set_uint32(dev, "irq", 10); + + qdev_prop_set_string(dev, "audiodev", + audio_maybe_init_dummy("ppc.defaudio")); isa_realize_and_unref(isa_dev, isa_bus, &error_fatal); =20 isa_dev =3D isa_new("pc87312"); --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876517778697.822967947788; Mon, 25 Apr 2022 01:48:37 -0700 (PDT) Received: from localhost ([::1]:45054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuOa-0002Dn-G9 for importer2@patchew.org; Mon, 25 Apr 2022 04:48:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0E-0006gM-HN for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu07-0002ix-9T for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:26 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-438-w0NTe48bPh2CHBc7ed6I1A-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wm1-f69.google.com with SMTP id t2-20020a7bc3c2000000b003528fe59cb9so6872357wmj.5 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id p125-20020a1c2983000000b0038e5ca446bcsm11127092wmp.5.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 6A5FE67B1B62; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=djWLap2ip9TeVgEs3MLYUVyamfKL3oD+pQvj2lMaBx8=; b=gl2BsEyC3vO+zCSBBWEUV8ZWRtuHuQaIiYUncCtsWeoek/wZ1CqUIykzzIMhwlSVClVeRi 6/OAn4J01JZJVwGvuRVIgaeqT4xRKLHs/wYI0g0UZ+7bzlF0gm0pO937P31ssLUGsB856Y laZJOfP2JWDRUIu6Us0tPNlHvu34m7M= X-MC-Unique: w0NTe48bPh2CHBc7ed6I1A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=djWLap2ip9TeVgEs3MLYUVyamfKL3oD+pQvj2lMaBx8=; b=1nSRmY4m4/6g6EJXagh+aUK5BtKPCv7wzF2eKiYvhAh+QlS411r6LBl+CwcusQ36eA cruIDrgPvf6jmTtpjfRlwOS8wZaZnD0541IPoctTB7xg5HMjV5MQLY++pgRxn4bXoyTa lEDn9FKXF1VGKPzpeWNWJZ8U+nbETdAdg1k/7wKfXsOiFt2rVtgWTaJZ9sDWZ6eTorKB tKIBEf1JswzbxTR7bRhKgLi/ARj8V43DaRBqG8QcHNO/hLzPasOV/A4IUFomX7AXMa/H PLPmAzQK6EzZjnuOgpdakKc4XYGb44e/k4ba9EP/5g0F7KDeS7pLUquckHp4+0XHq5Zy VPfA== X-Gm-Message-State: AOAM531q0zf0+1G7YE1M+LCr74AwQBJ9sUvIFL/XHHe9HXhslgvNU6oq 9MMCUATuWwbDBeth7bBWNAEoqbunhPrW9Op6qigW7//koefhr4uHIINzmVxjGdVLZXaG67TXPhM NzR6SbEGDB+mpv0Q= X-Received: by 2002:a05:600c:3548:b0:393:ecaa:d7ae with SMTP id i8-20020a05600c354800b00393ecaad7aemr2568977wmq.86.1650874926020; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSpUPPGaj+xMe6KY5CZvzkGY6Wv6xc3xHTYv5gfb5J122ujfuQZRQfwFQCPnAmuoxcSEng6g== X-Received: by 2002:a05:600c:3548:b0:393:ecaa:d7ae with SMTP id i8-20020a05600c354800b00393ecaad7aemr2568947wmq.86.1650874925705; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 13/18] audio: Make AUD_register_card fallible and require audiodev= Date: Mon, 25 Apr 2022 10:21:56 +0200 Message-Id: <92b31c6af268b8f2a4cc4ed5b20ee8d0e19f614d.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876520159100001 Content-Type: text/plain; charset="utf-8" Now that all callers support error reporting with errp and all machine-defa= ult devices use an explicit audiodev, this can be changed. To make the detecti= on easier make AUD_register_card() return false on error. Signed-off-by: Martin Kletzander --- audio/audio.c | 7 +++++-- audio/audio.h | 2 +- hw/arm/omap2.c | 3 ++- hw/audio/ac97.c | 6 +++++- hw/audio/adlib.c | 7 +++++-- hw/audio/cs4231a.c | 6 ++++-- hw/audio/es1370.c | 5 ++++- hw/audio/gus.c | 4 +++- hw/audio/hda-codec.c | 5 ++++- hw/audio/lm4549.c | 4 +++- hw/audio/pcspk.c | 4 +++- hw/audio/sb16.c | 6 ++++-- hw/audio/wm8750.c | 5 ++++- hw/display/xlnx_dp.c | 6 ++++-- hw/input/tsc210x.c | 3 ++- hw/usb/dev-audio.c | 5 ++++- 16 files changed, 57 insertions(+), 21 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 671845c65d18..b95aca444382 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1822,15 +1822,18 @@ void audio_free_audiodev_list(AudiodevListHead *hea= d) } } =20 -void AUD_register_card (const char *name, QEMUSoundCard *card) +bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p) { if (!card->state) { - card->state =3D audio_init(NULL, name); + error_setg(errp, "No audiodev specified for %s", name); + return false; } =20 card->name =3D g_strdup (name); memset (&card->entries, 0, sizeof (card->entries)); QLIST_INSERT_HEAD(&card->state->card_head, card, entries); + + return true; } =20 void AUD_remove_card (QEMUSoundCard *card) diff --git a/audio/audio.h b/audio/audio.h index 335704a4ddb1..9deed8ed6830 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -94,7 +94,7 @@ typedef struct QEMUAudioTimeStamp { void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF= (2, 0); void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 -void AUD_register_card (const char *name, QEMUSoundCard *card); +bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **err= p); void AUD_remove_card (QEMUSoundCard *card); CaptureVoiceOut *AUD_add_capture( AudioState *s, diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 4ae524a1a1a6..407c24551c84 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -618,7 +618,8 @@ static struct omap_eac_s *omap_eac_init(struct omap_tar= get_agent_s *ta, s->codec.card.name); } =20 - AUD_register_card("OMAP EAC", &s->codec.card); + /* We can quit here because this only gets called from machine class i= nit */ + AUD_register_card("OMAP EAC", &s->codec.card, &error_fatal); =20 memory_region_init_io(&s->iomem, NULL, &omap_eac_ops, s, "omap.eac", omap_l4_region_size(ta, 0)); diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index fd0b3b97d5b5..8242ddb0f93d 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1345,6 +1345,10 @@ static void ac97_realize(PCIDevice *dev, Error **err= p) AC97LinkState *s =3D AC97(dev); uint8_t *c =3D s->dev.config; =20 + if (!AUD_register_card ("ac97", &s->card, errp)) { + return; + } + /* TODO: no need to override */ c[PCI_COMMAND] =3D 0x00; /* pcicmd pci command rw, ro */ c[PCI_COMMAND + 1] =3D 0x00; @@ -1378,7 +1382,7 @@ static void ac97_realize(PCIDevice *dev, Error **errp) "ac97-nabm", 256); pci_register_bar (&s->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_nam); pci_register_bar (&s->dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &s->io_nabm); - AUD_register_card ("ac97", &s->card); + ac97_on_reset(DEVICE(s)); } =20 diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index ba1be6c8378d..39932654f7f5 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -269,8 +269,6 @@ static void adlib_realizefn (DeviceState *dev, Error **= errp) as.fmt =3D AUDIO_FORMAT_S16; as.endianness =3D AUDIO_HOST_ENDIANNESS; =20 - AUD_register_card ("adlib", &s->card); - s->voice =3D AUD_open_out ( &s->card, s->voice, @@ -285,6 +283,11 @@ static void adlib_realizefn (DeviceState *dev, Error *= *errp) return; } =20 + if (!AUD_register_card ("adlib", &s->card, errp)) { + Adlib_fini (s); + return; + } + s->samples =3D AUD_get_buffer_size_out (s->voice) >> SHIFT; s->mixbuf =3D g_malloc0 (s->samples << SHIFT); =20 diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index f510b862efbe..d9353a51ec66 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -676,13 +676,15 @@ static void cs4231a_realizefn (DeviceState *dev, Erro= r **errp) return; } =20 + if (!AUD_register_card ("cs4231a", &s->card, errp)) { + return; + } + s->pic =3D isa_get_irq(d, s->irq); k =3D ISADMA_GET_CLASS(s->isa_dma); k->register_channel(s->isa_dma, s->dma, cs_dma_read, s); =20 isa_register_ioport (d, &s->ioports, s->port); - - AUD_register_card ("cs4231a", &s->card); } =20 static Property cs4231a_properties[] =3D { diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 62359b84f279..77a84f83060b 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -867,7 +867,10 @@ static void es1370_realize(PCIDevice *dev, Error **err= p) memory_region_init_io (&s->io, OBJECT(s), &es1370_io_ops, s, "es1370",= 256); pci_register_bar (&s->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io); =20 - AUD_register_card ("es1370", &s->card); + if (!AUD_register_card ("es1370", &s->card, errp)) { + return; + } + es1370_reset (s); } =20 diff --git a/hw/audio/gus.c b/hw/audio/gus.c index c7710a684b88..f890042baa97 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -245,7 +245,9 @@ static void gus_realizefn (DeviceState *dev, Error **er= rp) return; } =20 - AUD_register_card ("gus", &s->card); + if (!AUD_register_card ("gus", &s->card, errp)) { + return; + } =20 as.freq =3D s->freq; as.nchannels =3D 2; diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index e86a2adf31a0..7f8a7fa7ca1b 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -690,7 +690,10 @@ static void hda_audio_init(HDACodecDevice *hda, a->name =3D object_get_typename(OBJECT(a)); dprint(a, 1, "%s: cad %d\n", __func__, a->hda.cad); =20 - AUD_register_card("hda", &a->card); + if (!AUD_register_card("hda", &a->card, errp)) { + return; + } + for (i =3D 0; i < a->desc->nnodes; i++) { node =3D a->desc->nodes + i; param =3D hda_codec_find_param(node, AC_PAR_AUDIO_WIDGET_CAP); diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index 418041bc9c6c..9afb81517e8f 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -289,7 +289,9 @@ void lm4549_init(lm4549_state *s, lm4549_callback data_= req_cb, void* opaque, lm4549_reset(s); =20 /* Register an audio card */ - AUD_register_card("lm4549", &s->card); + if (!AUD_register_card("lm4549", &s->card, errp)) { + return; + } =20 /* Open a default voice */ as.freq =3D 48000; diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 72bea5fb202a..41bf6a5cfdb3 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -122,7 +122,9 @@ static int pcspk_audio_init(PCSpkState *s) return 0; } =20 - AUD_register_card(s_spk, &s->card); + if (!AUD_register_card(s_spk, &s->card, NULL)) { + return -1; + } =20 s->voice =3D AUD_open_out(&s->card, s->voice, s_spk, s, pcspk_callback= , &as); if (!s->voice) { diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 593da2478c14..dd2131426cd3 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1400,6 +1400,10 @@ static void sb16_realizefn (DeviceState *dev, Error = **errp) SB16State *s =3D SB16 (dev); IsaDmaClass *k; =20 + if (!AUD_register_card ("sb16", &s->card, errp)) { + return; + } + s->isa_hdma =3D isa_get_dma(isa_bus_from_device(isadev), s->hdma); s->isa_dma =3D isa_get_dma(isa_bus_from_device(isadev), s->dma); if (!s->isa_dma || !s->isa_hdma) { @@ -1432,8 +1436,6 @@ static void sb16_realizefn (DeviceState *dev, Error *= *errp) k->register_channel(s->isa_dma, s->dma, SB_read_DMA, s); =20 s->can_write =3D 1; - - AUD_register_card ("sb16", &s->card); } =20 static Property sb16_properties[] =3D { diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index b5722b37c36b..57954a631442 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -624,7 +624,10 @@ static void wm8750_realize(DeviceState *dev, Error **e= rrp) { WM8750State *s =3D WM8750(dev); =20 - AUD_register_card(CODEC, &s->card); + if (!AUD_register_card(CODEC, &s->card, errp)) { + return; + } + wm8750_reset(I2C_SLAVE(s)); } =20 diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index b16d6be2b5cc..d6699f00d89e 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1278,6 +1278,10 @@ static void xlnx_dp_realize(DeviceState *dev, Error = **errp) DisplaySurface *surface; struct audsettings as; =20 + if (!AUD_register_card("xlnx_dp.audio", &s->aud_card, errp)) { + return; + } + aux_bus_realize(s->aux_bus); =20 qdev_realize(DEVICE(s->dpcd), BUS(s->aux_bus), &error_fatal); @@ -1296,8 +1300,6 @@ static void xlnx_dp_realize(DeviceState *dev, Error *= *errp) as.fmt =3D AUDIO_FORMAT_S16; as.endianness =3D 0; =20 - AUD_register_card("xlnx_dp.audio", &s->aud_card); - s->amixer_output_stream =3D AUD_open_out(&s->aud_card, s->amixer_output_stream, "xlnx_dp.audio.out", diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index f0b02bc72280..1ebf0199bfc7 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -1106,7 +1106,8 @@ static void tsc210x_init(TSC210xState *s, s->card.name); } =20 - AUD_register_card(s->name, &s->card); + /* We can quit here because this only gets called from machine class i= nit */ + AUD_register_card(s->name, &s->card, &error_fatal); =20 qemu_register_reset((void *) tsc210x_reset, s); vmstate_register(NULL, 0, vmsd, s); diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 8748c1ba0401..d5ac1f8962e3 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -944,12 +944,15 @@ static void usb_audio_realize(USBDevice *dev, Error *= *errp) USBAudioState *s =3D USB_AUDIO(dev); int i; =20 + if (!AUD_register_card(TYPE_USB_AUDIO, &s->card, errp)) { + return; + } + dev->usb_desc =3D s->multi ? &desc_audio_multi : &desc_audio; =20 usb_desc_create_serial(dev); usb_desc_init(dev); s->dev.opaque =3D s; - AUD_register_card(TYPE_USB_AUDIO, &s->card); =20 s->out.altset =3D ALTSET_OFF; s->out.vol.mute =3D false; --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875328117553.0026100242908; Mon, 25 Apr 2022 01:28:48 -0700 (PDT) Received: from localhost ([::1]:47540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niu5N-00017J-AY for importer2@patchew.org; Mon, 25 Apr 2022 04:28:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu07-0006Uv-1S for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002f6-RF for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-0BZ8KRkyO-eVP8GcnBWEBA-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wr1-f71.google.com with SMTP id k20-20020adfc714000000b001e305cd1597so3073953wrg.19 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id w5-20020a7bc105000000b0038eb9932dacsm7960786wmi.48.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 783A667B1B63; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uSjZ4QBWRDNWG4JCXGIx/l5GdZP0dmWgbGQwE/eNVLc=; b=ii7wxs3auKd/VMGjuiC5O2/C8wmbpXUNDCabWbPdFK1jzIQIPxYnQdDJNg1Vdb3TeodOk8 sxuIgF/goo00xjXD8BiDphepmhKsOv4Vxw/zUa6Hg4Qw51mDdAKduN9GysFRlba6Xj3ZDe eV1JOyoIFifa3BAXptiejzALAUNFDd4= X-MC-Unique: 0BZ8KRkyO-eVP8GcnBWEBA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uSjZ4QBWRDNWG4JCXGIx/l5GdZP0dmWgbGQwE/eNVLc=; b=GhLoR2qlKnoNFcLCsI8MIeOssOcNp645VWa6KZOLOTyca76ZC+aVhSzLP/mTLzQOBi YCgB8OSPMIeguN5bo7dabrgeLoxURGBS7LZKCZJEhR6cpQ4SRHqWRFT1sECltDdIpyTd Etvw8to1AHqVpvoZrGK0saL2fGhsZzCGs38cXsu8BNCX1FcLcs7/vVXtT7cW2GM3xfqc b1jaSH+G9N/wEMzT+MCo5dDpRywAKF7+HUNGdD/Uvny9TYbwyO9S9NWd/13Dw7tolkWr IOVxou9hMJArPBf0FOQtmA60qBbv0+GJCwVSVMLwIgkuEzSufA63jCBluIyOwee/NOpg 2wTA== X-Gm-Message-State: AOAM530l19gCUGn/qxBSBhXLnMoSBP6cyhVBj19z3eCsZGB9wuN4kY3g uJ8AvrdBgE1RutXb1GdYA4O0am/tU0vqCUMOU6LDoQ4A+PduaqOJqMzZ29kIkazW2P/FQiAyXgY wP7S7tx2/Vs5OQc0= X-Received: by 2002:a5d:414b:0:b0:20a:dc15:bd00 with SMTP id c11-20020a5d414b000000b0020adc15bd00mr2725008wrq.136.1650874926087; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8qC2lx1GQUGbLcuVMC7CuPZAW1FwOhnYZSanHQlE+T8VWSG0vRNi3RnDUInHu9vI2cxEZng== X-Received: by 2002:a5d:414b:0:b0:20a:dc15:bd00 with SMTP id c11-20020a5d414b000000b0020adc15bd00mr2724989wrq.136.1650874925839; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 14/18] audio: Require AudioState in AUD_add_capture Date: Mon, 25 Apr 2022 10:21:57 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875357694100003 Content-Type: text/plain; charset="utf-8" Since all callers require a valid audiodev this function can now safely abort in case of missing AudioState. Signed-off-by: Martin Kletzander --- audio/audio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index b95aca444382..97eb645764c1 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1855,10 +1855,8 @@ CaptureVoiceOut *AUD_add_capture( struct capture_callback *cb; =20 if (!s) { - if (!legacy_config) { - dolog("Capturing without setting an audiodev is deprecated\n"); - } - s =3D audio_init(NULL, NULL); + error_setg(&error_abort, + "Capturing without setting an audiodev is not supported= "); } =20 if (!audio_get_pdo_out(s->dev)->mixing_engine) { --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650876226765654.4049622413713; Mon, 25 Apr 2022 01:43:46 -0700 (PDT) Received: from localhost ([::1]:37012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuJt-0005Co-KY for importer2@patchew.org; Mon, 25 Apr 2022 04:43:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0s-0007Li-Nh for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0p-0002rN-3O for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:06 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-231-eSoNJ_fMOP2m9gfKt_Yyfg-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wr1-f70.google.com with SMTP id e21-20020adfa455000000b0020ae075cf35so88991wra.11 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id i6-20020a0560001ac600b0020a93f75030sm8609662wry.48.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 84EB767B1B64; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650875042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FhQkwseUjLTHOIhK75umw1DiZK4WT0Kj4VwxUvLlvB0=; b=UQh/XdTv7LZr8nL08xhLVFE/zBqJjPlXjOCDgCiQwRwKmAxGNbzTwxnt9xXCbXBDwomjoo RieNtfAOUcXw4UmZy7qnXaoRkYb3vKzHxStZHfb5KzHt8F+QdFpu5vT4Ad9dY9frIt9ch3 81Yp/yAUTWeLc6+rxnbHjwL5LRZunu4= X-MC-Unique: eSoNJ_fMOP2m9gfKt_Yyfg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FhQkwseUjLTHOIhK75umw1DiZK4WT0Kj4VwxUvLlvB0=; b=721brlw9+8aCBsKCft32504CZbDqrZ9UH6Hy1SfUbjmp5/pku6KvuyHDc07P3XhH46 f/ZI8H+atHoT+7yQf8kd6GiqKNRCwX536QDtCbP3kQPiRm9oa9jKr8PnIZH6xtgUkLGQ mHYNXzXxYn2ctVd72oNz2HPgmj+AEYAVwoMg0egxX5+fnP5ODPG18RK65Rl1TaORjtFB aWjTV85TS66OHu0mTGaZKjdDi6cULA47BrBy29URt/xaW5/3ICb7xcoYNf+9lpfjtn7q PgmVayeNKm10HQkll9/nXtLpacDFUjWldu2dDJu1d/oqi1dp1aRlwGWitMnI7hColgKC ce1A== X-Gm-Message-State: AOAM5316O+5morU9JDLzAmm99oAzt65cUSAJTLXMZjDvQfHpFfdKg7qJ IoooxF/Ga9Mw3SK5s5pzvbGHjFaAK7J0M07U7s0harMl88FQpmgcrl81KnN4XzKmitAhAsMUwQP QSc2BEoIhmUUIbZo= X-Received: by 2002:a05:600c:21d1:b0:381:4fed:159a with SMTP id x17-20020a05600c21d100b003814fed159amr15601984wmj.143.1650874926493; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/3dRybdDZDRPKfC75dqpdz6R++AejA2+IGjo2roCm92HFyDce4aP6XDzA5ArkFmkvTb/YyA== X-Received: by 2002:a05:600c:21d1:b0:381:4fed:159a with SMTP id x17-20020a05600c21d100b003814fed159amr15601961wmj.143.1650874926243; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 15/18] audio: Be more strict during audio backend initialisation Date: Mon, 25 Apr 2022 10:21:58 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650876227222100002 Content-Type: text/plain; charset="utf-8" Now that audiodev=3D is required and audio_init() will not be called without and AudioDev we can remove the fallback functionality and error out in case audio drivers fail initialisation or when the driver does not exist. Signed-off-by: Martin Kletzander --- audio/audio.c | 146 ++++++-------------------------- docs/about/deprecated.rst | 8 -- docs/about/removed-features.rst | 8 ++ 3 files changed, 34 insertions(+), 128 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 97eb645764c1..c944cf817cf9 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -87,6 +87,8 @@ audio_driver *audio_driver_lookup(const char *name) } } =20 + error_setg(&error_fatal, "Unknown audio driver `%s'", name); + /* Avoid compiler complaining that we do not return in non-void functi= on */ return NULL; } =20 @@ -104,8 +106,6 @@ const struct mixeng_volume nominal_volume =3D { #endif }; =20 -static bool legacy_config =3D true; - int audio_bug (const char *funcname, int cond) { if (cond) { @@ -1532,31 +1532,27 @@ size_t audio_generic_read(HWVoiceIn *hw, void *buf,= size_t size) return total; } =20 -static int audio_driver_init(AudioState *s, struct audio_driver *drv, - bool msg, Audiodev *dev) +static void audio_driver_init(AudioState *s, struct audio_driver *drv, + Audiodev *dev) { s->drv_opaque =3D drv->init(dev); =20 - if (s->drv_opaque) { - if (!drv->pcm_ops->get_buffer_in) { - drv->pcm_ops->get_buffer_in =3D audio_generic_get_buffer_in; - drv->pcm_ops->put_buffer_in =3D audio_generic_put_buffer_in; - } - if (!drv->pcm_ops->get_buffer_out) { - drv->pcm_ops->get_buffer_out =3D audio_generic_get_buffer_out; - drv->pcm_ops->put_buffer_out =3D audio_generic_put_buffer_out; - } + if (!s->drv_opaque) { + error_setg(&error_fatal, "Could not init `%s' audio driver", drv->= name); + } =20 - audio_init_nb_voices_out(s, drv); - audio_init_nb_voices_in(s, drv); - s->drv =3D drv; - return 0; - } else { - if (msg) { - dolog("Could not init `%s' audio driver\n", drv->name); - } - return -1; + if (!drv->pcm_ops->get_buffer_in) { + drv->pcm_ops->get_buffer_in =3D audio_generic_get_buffer_in; + drv->pcm_ops->put_buffer_in =3D audio_generic_put_buffer_in; } + if (!drv->pcm_ops->get_buffer_out) { + drv->pcm_ops->get_buffer_out =3D audio_generic_get_buffer_out; + drv->pcm_ops->put_buffer_out =3D audio_generic_put_buffer_out; + } + + audio_init_nb_voices_out(s, drv); + audio_init_nb_voices_in(s, drv); + s->drv =3D drv; } =20 static void audio_vm_change_state_handler (void *opaque, bool running, @@ -1661,79 +1657,19 @@ static const VMStateDescription vmstate_audio =3D { =20 static void audio_validate_opts(Audiodev *dev, Error **errp); =20 -static AudiodevListEntry *audiodev_find( - AudiodevListHead *head, const char *drvname) -{ - AudiodevListEntry *e; - QSIMPLEQ_FOREACH(e, head, next) { - if (strcmp(AudiodevDriver_str(e->dev->driver), drvname) =3D=3D 0) { - return e; - } - } - - return NULL; -} - -/* - * if we have dev, this function was called because of an -audiodev argume= nt =3D> - * initialize a new state with it - * if dev =3D=3D NULL =3D> legacy implicit initialization, return the alre= ady created - * state or create a new one - */ -static AudioState *audio_init(Audiodev *dev, const char *name) +static AudioState *audio_init(Audiodev *dev) { static bool atexit_registered; - size_t i; - int done =3D 0; const char *drvname =3D NULL; VMChangeStateEntry *e; AudioState *s; - struct audio_driver *driver; - /* silence gcc warning about uninitialized variable */ - AudiodevListHead head =3D QSIMPLEQ_HEAD_INITIALIZER(head); - - if (using_spice) { - /* - * When using spice allow the spice audio driver being picked - * as default. - * - * Temporary hack. Using audio devices without explicit - * audiodev=3D property is already deprecated. Same goes for - * the -soundhw switch. Once this support gets finally - * removed we can also drop the concept of a default audio - * backend and this can go away. - */ - driver =3D audio_driver_lookup("spice"); - if (driver) { - driver->can_be_default =3D 1; - } - } =20 - if (dev) { - /* -audiodev option */ - legacy_config =3D false; - drvname =3D AudiodevDriver_str(dev->driver); - } else if (!QTAILQ_EMPTY(&audio_states)) { - if (!legacy_config) { - dolog("Device %s: audiodev default parameter is deprecated, pl= ease " - "specify audiodev=3D%s\n", name, - QTAILQ_FIRST(&audio_states)->dev->id); - } - return QTAILQ_FIRST(&audio_states); - } else { - /* legacy implicit initialization */ - head =3D audio_handle_legacy_opts(); - /* - * In case of legacy initialization, all Audiodevs in the list wil= l have - * the same configuration (except the driver), so it doesn't matte= r which - * one we chose. We need an Audiodev to set up AudioState before = we can - * init a driver. Also note that dev at this point is still in the - * list. - */ - dev =3D QSIMPLEQ_FIRST(&head)->dev; - audio_validate_opts(dev, &error_abort); + if (!dev) { + error_setg(&error_abort, "Mandatory audiodev parameter required"); } =20 + drvname =3D AudiodevDriver_str(dev->driver); + s =3D g_new0(AudioState, 1); s->dev =3D dev; =20 @@ -1763,37 +1699,7 @@ static AudioState *audio_init(Audiodev *dev, const c= har *name) s->nb_hw_voices_in =3D 0; } =20 - if (drvname) { - driver =3D audio_driver_lookup(drvname); - if (driver) { - done =3D !audio_driver_init(s, driver, true, dev); - } else { - dolog ("Unknown audio driver `%s'\n", drvname); - } - } else { - for (i =3D 0; audio_prio_list[i]; i++) { - AudiodevListEntry *e =3D audiodev_find(&head, audio_prio_list[= i]); - driver =3D audio_driver_lookup(audio_prio_list[i]); - - if (e && driver) { - s->dev =3D dev =3D e->dev; - audio_validate_opts(dev, &error_abort); - done =3D !audio_driver_init(s, driver, false, dev); - if (done) { - e->dev =3D NULL; - break; - } - } - } - } - audio_free_audiodev_list(&head); - - if (!done) { - driver =3D audio_driver_lookup("none"); - done =3D !audio_driver_init(s, driver, false, dev); - assert(done); - dolog("warning: Using timer based audio emulation\n"); - } + audio_driver_init(s, audio_driver_lookup(drvname), dev); =20 if (dev->timer_period <=3D 0) { s->period_ticks =3D 1; @@ -2120,7 +2026,7 @@ void audio_init_audiodevs(void) AudiodevListEntry *e; =20 QSIMPLEQ_FOREACH(e, &audiodevs, next) { - audio_init(e->dev, NULL); + audio_init(e->dev); } } =20 @@ -2133,7 +2039,7 @@ static void audio_init_dummy(const char *id) dev->id =3D g_strdup(id); =20 audio_validate_opts(dev, &error_abort); - audio_init(dev, NULL); + audio_init(dev); =20 e->dev =3D dev; QSIMPLEQ_INSERT_TAIL(&audiodevs, e, next); diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7ba71ebd3435..b2255319e347 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -31,14 +31,6 @@ backend settings instead of environment variables. To e= ase migration to the new format, the ``-audiodev-help`` option can be used to convert the current values of the environment variables to ``-audiodev`` options. =20 -Creating sound card devices and vnc without ``audiodev=3D`` property (sinc= e 4.2) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= '''' - -When not using the deprecated legacy audio config, each sound card -should specify an ``audiodev=3D`` property. Additionally, when using -vnc, you should specify an ``audiodev=3D`` property if you plan to -transmit audio through the VNC protocol. - ``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 086ba3edb042..f9eea4dda327 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -346,6 +346,14 @@ needs two devices (``-device intel-hda -device hda-dup= lex``) and pcspk-audiodev=3D``. And ``AC97`` and ``ES1370`` now have to be specified in uppercase. =20 +Creating sound card devices and vnc without ``audiodev=3D`` property (remo= ved in 7.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= ''''''''' + +When not using the deprecated legacy audio config, each sound card +should specify an ``audiodev=3D`` property. Additionally, when using +vnc, you should specify an ``audiodev=3D`` property if you plan to +transmit audio through the VNC protocol. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650877061179986.9640612035033; Mon, 25 Apr 2022 01:57:41 -0700 (PDT) Received: from localhost ([::1]:60460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuXM-0004RX-2F for importer2@patchew.org; Mon, 25 Apr 2022 04:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0H-0006m1-2x for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0A-0002kC-4C for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:28 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-JpLUWNKGOoiqgu3X6PcqQw-1; Mon, 25 Apr 2022 04:22:08 -0400 Received: by mail-wr1-f70.google.com with SMTP id t15-20020adfdc0f000000b001ef93643476so3063398wri.2 for ; Mon, 25 Apr 2022 01:22:08 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o2-20020a5d6482000000b0020a96536fcdsm8850332wri.57.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 87D8D67B1B65; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650875001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RNMCFsdt1DfVphZXSznWDAJKRd268N5F4URsC76WAsg=; b=CjtelYpu9DYapbzsI7BNxKPdDRNC626t9YcG1ytujj3v8sXU6F68wEClrEE4/jfRTNh9OM cpMRaGqqt5G+0Pabr8ksL4rDeYipe8R29i86YihYGbg2AbsZ2mE1DnNYFVvb9rL1PQI8tc gezSgjeJNXnOMTZUPT4ArAkUyhMv81g= X-MC-Unique: JpLUWNKGOoiqgu3X6PcqQw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RNMCFsdt1DfVphZXSznWDAJKRd268N5F4URsC76WAsg=; b=Q2vMnfhP7cp53eg3mjI5AxLAQTUka2nc8+I4E7i0W3FnCti84qVMb7lFxcqRWQR7ed +el0tUD4HLI43N0ItJlUHYCNaezHGU44EQe9NCSxTJqb1jDIF6SBoIG7Lh0CczwFmz+X /mDnKGMGldXIWPZTztasq0hs1IvMz79nDv4GshqhmD4rGTmIzPPRXAOQGqFF+qkzv3pO FDWy6wHWF9mPi30DqEj5V9YDdzyUHoDqGuci4M101iQ7AYvL0tubSd95lP4GRwt0000H qciOnJcmBfvVMUexuN8zoSgzd+rr5Wp+RTcAq7H1BhsZOQmHN8ojLpl96ixDOW1AGQOG 31DQ== X-Gm-Message-State: AOAM532R/+S82Fvtt+doWpiEwzrWcyqfebWB+DH9OMrzzZkAVLkxOa4F gL8dwQ0+w9dc+yaekzX8mMwaNmMA/54zCbEtUbE0AjO2UscKHtHkVzjPWqLUJioTq+cqyedOmt5 glyltQ+D8dKYECgQ= X-Received: by 2002:a5d:4fca:0:b0:20a:cf56:a894 with SMTP id h10-20020a5d4fca000000b0020acf56a894mr9298191wrw.528.1650874926947; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+f/2SVdHUly0vy5r/Hl7JL7WORn5lIVFTyZ0TioUZEj7Zl6cNy8EfBhjEkf0JCtk+xrBUqg== X-Received: by 2002:a5d:4fca:0:b0:20a:cf56:a894 with SMTP id h10-20020a5d4fca000000b0020acf56a894mr9298165wrw.528.1650874926539; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 16/18] audio: Remove legacy audio environment variables and options Date: Mon, 25 Apr 2022 10:21:59 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650877063089100001 Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- audio/audio.c | 13 - audio/audio.h | 1 - audio/audio_legacy.c | 555 -------------------------------- audio/meson.build | 1 - docs/about/deprecated.rst | 7 - docs/about/removed-features.rst | 9 + qemu-options.hx | 10 - softmmu/vl.c | 4 - 8 files changed, 9 insertions(+), 591 deletions(-) delete mode 100644 audio/audio_legacy.c diff --git a/audio/audio.c b/audio/audio.c index c944cf817cf9..b3ecc8fa6508 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -49,19 +49,6 @@ =20 #define SW_NAME(sw) (sw)->name ? (sw)->name : "unknown" =20 - -/* Order of CONFIG_AUDIO_DRIVERS is import. - The 1st one is the one used by default, that is the reason - that we generate the list. -*/ -const char *audio_prio_list[] =3D { - "spice", - CONFIG_AUDIO_DRIVERS - "none", - "wav", - NULL -}; - static QLIST_HEAD(, audio_driver) audio_drivers; static AudiodevListHead audiodevs =3D QSIMPLEQ_HEAD_INITIALIZER(audiodevs); =20 diff --git a/audio/audio.h b/audio/audio.h index 9deed8ed6830..ae10a7f0fa81 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -170,7 +170,6 @@ void audio_sample_from_uint64(void *samples, int pos, =20 void audio_parse_option(const char *opt); void audio_init_audiodevs(void); -void audio_legacy_help(void); =20 AudioState *audio_state_by_name(const char *name); const char *audio_get_id(QEMUSoundCard *card); diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c deleted file mode 100644 index 595949f52cd4..000000000000 --- a/audio/audio_legacy.c +++ /dev/null @@ -1,555 +0,0 @@ -/* - * QEMU Audio subsystem: legacy configuration handling - * - * Copyright (c) 2015-2019 Zolt=C3=A1n K=C5=91v=C3=A1g=C3=B3 - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ -#include "qemu/osdep.h" -#include "audio.h" -#include "audio_int.h" -#include "qemu/cutils.h" -#include "qemu/timer.h" -#include "qapi/error.h" -#include "qapi/qapi-visit-audio.h" -#include "qapi/visitor-impl.h" - -#define AUDIO_CAP "audio-legacy" -#include "audio_int.h" - -static uint32_t toui32(const char *str) -{ - unsigned long long ret; - if (parse_uint_full(str, &ret, 10) || ret > UINT32_MAX) { - dolog("Invalid integer value `%s'\n", str); - exit(1); - } - return ret; -} - -/* helper functions to convert env variables */ -static void get_bool(const char *env, bool *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val) !=3D 0; - *has_dst =3D true; - } -} - -static void get_int(const char *env, uint32_t *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val); - *has_dst =3D true; - } -} - -static void get_str(const char *env, char **dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - if (*has_dst) { - g_free(*dst); - } - *dst =3D g_strdup(val); - *has_dst =3D true; - } -} - -static void get_fmt(const char *env, AudioFormat *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - size_t i; - for (i =3D 0; AudioFormat_lookup.size; ++i) { - if (strcasecmp(val, AudioFormat_lookup.array[i]) =3D=3D 0) { - *dst =3D i; - *has_dst =3D true; - return; - } - } - - dolog("Invalid audio format `%s'\n", val); - exit(1); - } -} - - -static void get_millis_to_usecs(const char *env, uint32_t *dst, bool *has_= dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val) * 1000; - *has_dst =3D true; - } -} - -static uint32_t frames_to_usecs(uint32_t frames, - AudiodevPerDirectionOptions *pdo) -{ - uint32_t freq =3D pdo->has_frequency ? pdo->frequency : 44100; - return (frames * 1000000 + freq / 2) / freq; -} - - -static void get_frames_to_usecs(const char *env, uint32_t *dst, bool *has_= dst, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D frames_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} - -static uint32_t samples_to_usecs(uint32_t samples, - AudiodevPerDirectionOptions *pdo) -{ - uint32_t channels =3D pdo->has_channels ? pdo->channels : 2; - return frames_to_usecs(samples / channels, pdo); -} - -static void get_samples_to_usecs(const char *env, uint32_t *dst, bool *has= _dst, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D samples_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} - -static uint32_t bytes_to_usecs(uint32_t bytes, AudiodevPerDirectionOptions= *pdo) -{ - AudioFormat fmt =3D pdo->has_format ? pdo->format : AUDIO_FORMAT_S16; - uint32_t bytes_per_sample =3D audioformat_bytes_per_sample(fmt); - return samples_to_usecs(bytes / bytes_per_sample, pdo); -} - -static void get_bytes_to_usecs(const char *env, uint32_t *dst, bool *has_d= st, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D bytes_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} - -/* backend specific functions */ -/* ALSA */ -static void handle_alsa_per_direction( - AudiodevAlsaPerDirectionOptions *apdo, const char *prefix) -{ - char buf[64]; - size_t len =3D strlen(prefix); - bool size_in_usecs =3D false; - bool dummy; - - memcpy(buf, prefix, len); - strcpy(buf + len, "TRY_POLL"); - get_bool(buf, &apdo->try_poll, &apdo->has_try_poll); - - strcpy(buf + len, "DEV"); - get_str(buf, &apdo->dev, &apdo->has_dev); - - strcpy(buf + len, "SIZE_IN_USEC"); - get_bool(buf, &size_in_usecs, &dummy); - - strcpy(buf + len, "PERIOD_SIZE"); - get_int(buf, &apdo->period_length, &apdo->has_period_length); - if (apdo->has_period_length && !size_in_usecs) { - apdo->period_length =3D frames_to_usecs( - apdo->period_length, - qapi_AudiodevAlsaPerDirectionOptions_base(apdo)); - } - - strcpy(buf + len, "BUFFER_SIZE"); - get_int(buf, &apdo->buffer_length, &apdo->has_buffer_length); - if (apdo->has_buffer_length && !size_in_usecs) { - apdo->buffer_length =3D frames_to_usecs( - apdo->buffer_length, - qapi_AudiodevAlsaPerDirectionOptions_base(apdo)); - } -} - -static void handle_alsa(Audiodev *dev) -{ - AudiodevAlsaOptions *aopt =3D &dev->u.alsa; - handle_alsa_per_direction(aopt->in, "QEMU_ALSA_ADC_"); - handle_alsa_per_direction(aopt->out, "QEMU_ALSA_DAC_"); - - get_millis_to_usecs("QEMU_ALSA_THRESHOLD", - &aopt->threshold, &aopt->has_threshold); -} - -/* coreaudio */ -static void handle_coreaudio(Audiodev *dev) -{ - get_frames_to_usecs( - "QEMU_COREAUDIO_BUFFER_SIZE", - &dev->u.coreaudio.out->buffer_length, - &dev->u.coreaudio.out->has_buffer_length, - qapi_AudiodevCoreaudioPerDirectionOptions_base(dev->u.coreaudio.ou= t)); - get_int("QEMU_COREAUDIO_BUFFER_COUNT", - &dev->u.coreaudio.out->buffer_count, - &dev->u.coreaudio.out->has_buffer_count); -} - -/* dsound */ -static void handle_dsound(Audiodev *dev) -{ - get_millis_to_usecs("QEMU_DSOUND_LATENCY_MILLIS", - &dev->u.dsound.latency, &dev->u.dsound.has_latency= ); - get_bytes_to_usecs("QEMU_DSOUND_BUFSIZE_OUT", - &dev->u.dsound.out->buffer_length, - &dev->u.dsound.out->has_buffer_length, - dev->u.dsound.out); - get_bytes_to_usecs("QEMU_DSOUND_BUFSIZE_IN", - &dev->u.dsound.in->buffer_length, - &dev->u.dsound.in->has_buffer_length, - dev->u.dsound.in); -} - -/* OSS */ -static void handle_oss_per_direction( - AudiodevOssPerDirectionOptions *opdo, const char *try_poll_env, - const char *dev_env) -{ - get_bool(try_poll_env, &opdo->try_poll, &opdo->has_try_poll); - get_str(dev_env, &opdo->dev, &opdo->has_dev); - - get_bytes_to_usecs("QEMU_OSS_FRAGSIZE", - &opdo->buffer_length, &opdo->has_buffer_length, - qapi_AudiodevOssPerDirectionOptions_base(opdo)); - get_int("QEMU_OSS_NFRAGS", &opdo->buffer_count, - &opdo->has_buffer_count); -} - -static void handle_oss(Audiodev *dev) -{ - AudiodevOssOptions *oopt =3D &dev->u.oss; - handle_oss_per_direction(oopt->in, "QEMU_AUDIO_ADC_TRY_POLL", - "QEMU_OSS_ADC_DEV"); - handle_oss_per_direction(oopt->out, "QEMU_AUDIO_DAC_TRY_POLL", - "QEMU_OSS_DAC_DEV"); - - get_bool("QEMU_OSS_MMAP", &oopt->try_mmap, &oopt->has_try_mmap); - get_bool("QEMU_OSS_EXCLUSIVE", &oopt->exclusive, &oopt->has_exclusive); - get_int("QEMU_OSS_POLICY", &oopt->dsp_policy, &oopt->has_dsp_policy); -} - -/* pulseaudio */ -static void handle_pa_per_direction( - AudiodevPaPerDirectionOptions *ppdo, const char *env) -{ - get_str(env, &ppdo->name, &ppdo->has_name); -} - -static void handle_pa(Audiodev *dev) -{ - handle_pa_per_direction(dev->u.pa.in, "QEMU_PA_SOURCE"); - handle_pa_per_direction(dev->u.pa.out, "QEMU_PA_SINK"); - - get_samples_to_usecs( - "QEMU_PA_SAMPLES", &dev->u.pa.in->buffer_length, - &dev->u.pa.in->has_buffer_length, - qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.in)); - get_samples_to_usecs( - "QEMU_PA_SAMPLES", &dev->u.pa.out->buffer_length, - &dev->u.pa.out->has_buffer_length, - qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.out)); - - get_str("QEMU_PA_SERVER", &dev->u.pa.server, &dev->u.pa.has_server); -} - -/* SDL */ -static void handle_sdl(Audiodev *dev) -{ - /* SDL is output only */ - get_samples_to_usecs("QEMU_SDL_SAMPLES", &dev->u.sdl.out->buffer_lengt= h, - &dev->u.sdl.out->has_buffer_length, - qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.out)); -} - -/* wav */ -static void handle_wav(Audiodev *dev) -{ - get_int("QEMU_WAV_FREQUENCY", - &dev->u.wav.out->frequency, &dev->u.wav.out->has_frequency); - get_fmt("QEMU_WAV_FORMAT", &dev->u.wav.out->format, - &dev->u.wav.out->has_format); - get_int("QEMU_WAV_DAC_FIXED_CHANNELS", - &dev->u.wav.out->channels, &dev->u.wav.out->has_channels); - get_str("QEMU_WAV_PATH", &dev->u.wav.path, &dev->u.wav.has_path); -} - -/* general */ -static void handle_per_direction( - AudiodevPerDirectionOptions *pdo, const char *prefix) -{ - char buf[64]; - size_t len =3D strlen(prefix); - - memcpy(buf, prefix, len); - strcpy(buf + len, "FIXED_SETTINGS"); - get_bool(buf, &pdo->fixed_settings, &pdo->has_fixed_settings); - - strcpy(buf + len, "FIXED_FREQ"); - get_int(buf, &pdo->frequency, &pdo->has_frequency); - - strcpy(buf + len, "FIXED_FMT"); - get_fmt(buf, &pdo->format, &pdo->has_format); - - strcpy(buf + len, "FIXED_CHANNELS"); - get_int(buf, &pdo->channels, &pdo->has_channels); - - strcpy(buf + len, "VOICES"); - get_int(buf, &pdo->voices, &pdo->has_voices); -} - -static AudiodevListEntry *legacy_opt(const char *drvname) -{ - AudiodevListEntry *e =3D g_new0(AudiodevListEntry, 1); - e->dev =3D g_new0(Audiodev, 1); - e->dev->id =3D g_strdup(drvname); - e->dev->driver =3D qapi_enum_parse( - &AudiodevDriver_lookup, drvname, -1, &error_abort); - - audio_create_pdos(e->dev); - - handle_per_direction(audio_get_pdo_in(e->dev), "QEMU_AUDIO_ADC_"); - handle_per_direction(audio_get_pdo_out(e->dev), "QEMU_AUDIO_DAC_"); - - /* Original description: Timer period in HZ (0 - use lowest possible) = */ - get_int("QEMU_AUDIO_TIMER_PERIOD", - &e->dev->timer_period, &e->dev->has_timer_period); - if (e->dev->has_timer_period && e->dev->timer_period) { - e->dev->timer_period =3D NANOSECONDS_PER_SECOND / 1000 / - e->dev->timer_period; - } - - switch (e->dev->driver) { - case AUDIODEV_DRIVER_ALSA: - handle_alsa(e->dev); - break; - - case AUDIODEV_DRIVER_COREAUDIO: - handle_coreaudio(e->dev); - break; - - case AUDIODEV_DRIVER_DSOUND: - handle_dsound(e->dev); - break; - - case AUDIODEV_DRIVER_OSS: - handle_oss(e->dev); - break; - - case AUDIODEV_DRIVER_PA: - handle_pa(e->dev); - break; - - case AUDIODEV_DRIVER_SDL: - handle_sdl(e->dev); - break; - - case AUDIODEV_DRIVER_WAV: - handle_wav(e->dev); - break; - - default: - break; - } - - return e; -} - -AudiodevListHead audio_handle_legacy_opts(void) -{ - const char *drvname =3D getenv("QEMU_AUDIO_DRV"); - AudiodevListHead head =3D QSIMPLEQ_HEAD_INITIALIZER(head); - - if (drvname) { - AudiodevListEntry *e; - audio_driver *driver =3D audio_driver_lookup(drvname); - if (!driver) { - dolog("Unknown audio driver `%s'\n", drvname); - exit(1); - } - e =3D legacy_opt(drvname); - QSIMPLEQ_INSERT_TAIL(&head, e, next); - } else { - for (int i =3D 0; audio_prio_list[i]; i++) { - audio_driver *driver =3D audio_driver_lookup(audio_prio_list[i= ]); - if (driver && driver->can_be_default) { - AudiodevListEntry *e =3D legacy_opt(driver->name); - QSIMPLEQ_INSERT_TAIL(&head, e, next); - } - } - if (QSIMPLEQ_EMPTY(&head)) { - dolog("Internal error: no default audio driver available\n"); - exit(1); - } - } - - return head; -} - -/* visitor to print -audiodev option */ -typedef struct { - Visitor visitor; - - bool comma; - GList *path; -} LegacyPrintVisitor; - -static bool lv_start_struct(Visitor *v, const char *name, void **obj, - size_t size, Error **errp) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - lv->path =3D g_list_append(lv->path, g_strdup(name)); - return true; -} - -static void lv_end_struct(Visitor *v, void **obj) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - lv->path =3D g_list_delete_link(lv->path, g_list_last(lv->path)); -} - -static void lv_print_key(Visitor *v, const char *name) -{ - GList *e; - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - if (lv->comma) { - putchar(','); - } else { - lv->comma =3D true; - } - - for (e =3D lv->path; e; e =3D e->next) { - if (e->data) { - printf("%s.", (const char *) e->data); - } - } - - printf("%s=3D", name); -} - -static bool lv_type_int64(Visitor *v, const char *name, int64_t *obj, - Error **errp) -{ - lv_print_key(v, name); - printf("%" PRIi64, *obj); - return true; -} - -static bool lv_type_uint64(Visitor *v, const char *name, uint64_t *obj, - Error **errp) -{ - lv_print_key(v, name); - printf("%" PRIu64, *obj); - return true; -} - -static bool lv_type_bool(Visitor *v, const char *name, bool *obj, Error **= errp) -{ - lv_print_key(v, name); - printf("%s", *obj ? "on" : "off"); - return true; -} - -static bool lv_type_str(Visitor *v, const char *name, char **obj, Error **= errp) -{ - const char *str =3D *obj; - lv_print_key(v, name); - - while (*str) { - if (*str =3D=3D ',') { - putchar(','); - } - putchar(*str++); - } - return true; -} - -static void lv_complete(Visitor *v, void *opaque) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - assert(lv->path =3D=3D NULL); -} - -static void lv_free(Visitor *v) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - - g_list_free_full(lv->path, g_free); - g_free(lv); -} - -static Visitor *legacy_visitor_new(void) -{ - LegacyPrintVisitor *lv =3D g_new0(LegacyPrintVisitor, 1); - - lv->visitor.start_struct =3D lv_start_struct; - lv->visitor.end_struct =3D lv_end_struct; - /* lists not supported */ - lv->visitor.type_int64 =3D lv_type_int64; - lv->visitor.type_uint64 =3D lv_type_uint64; - lv->visitor.type_bool =3D lv_type_bool; - lv->visitor.type_str =3D lv_type_str; - - lv->visitor.type =3D VISITOR_OUTPUT; - lv->visitor.complete =3D lv_complete; - lv->visitor.free =3D lv_free; - - return &lv->visitor; -} - -void audio_legacy_help(void) -{ - AudiodevListHead head; - AudiodevListEntry *e; - - printf("Environment variable based configuration deprecated.\n"); - printf("Please use the new -audiodev option.\n"); - - head =3D audio_handle_legacy_opts(); - printf("\nEquivalent -audiodev to your current environment variables:\= n"); - if (!getenv("QEMU_AUDIO_DRV")) { - printf("(Since you didn't specify QEMU_AUDIO_DRV, I'll list all " - "possibilities)\n"); - } - - QSIMPLEQ_FOREACH(e, &head, next) { - Visitor *v; - Audiodev *dev =3D e->dev; - printf("-audiodev "); - - v =3D legacy_visitor_new(); - visit_type_Audiodev(v, NULL, &dev, &error_abort); - visit_free(v); - - printf("\n"); - } - audio_free_audiodev_list(&head); -} diff --git a/audio/meson.build b/audio/meson.build index 94dab16891d5..d73155d2f2ae 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -1,6 +1,5 @@ softmmu_ss.add([spice_headers, files('audio.c')]) softmmu_ss.add(files( - 'audio_legacy.c', 'mixeng.c', 'noaudio.c', 'wavaudio.c', diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index b2255319e347..7cc44e611ebe 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -23,13 +23,6 @@ deprecated. System emulator command line arguments -------------------------------------- =20 -``QEMU_AUDIO_`` environment variables and ``-audio-help`` (since 4.0) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -The ``-audiodev`` argument is now the preferred way to specify audio -backend settings instead of environment variables. To ease migration to -the new format, the ``-audiodev-help`` option can be used to convert -the current values of the environment variables to ``-audiodev`` options. =20 ``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index f9eea4dda327..e2a95baf9031 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -354,6 +354,15 @@ should specify an ``audiodev=3D`` property. Additiona= lly, when using vnc, you should specify an ``audiodev=3D`` property if you plan to transmit audio through the VNC protocol. =20 +``QEMU_AUDIO_`` environment variables and ``-audio-help`` (removed in 7.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The ``-audiodev`` argument is now the preferred way to specify audio +backend settings instead of environment variables. To ease migration to +the new format, the ``-audio-help`` option can be used with older QEMU +binaries to convert some of the old values of the environment variables +to new ``-audiodev`` options. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index 47bbd86a4533..b45d488440fc 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -651,16 +651,6 @@ SRST ERST =20 =20 -HXCOMM Deprecated by -audiodev -DEF("audio-help", 0, QEMU_OPTION_audio_help, - "-audio-help show -audiodev equivalent of the currently specified = audio settings\n", - QEMU_ARCH_ALL) -SRST -``-audio-help`` - Will show the -audiodev equivalent of the currently specified - (deprecated) environment variables. -ERST - DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, "-audiodev [driver=3D]driver,id=3Did[,prop[=3Dvalue][,...]]\n" " specifies the audio backend to use\n" diff --git a/softmmu/vl.c b/softmmu/vl.c index 2f7158574e4f..248bf8f66c4c 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3008,10 +3008,6 @@ void qemu_init(int argc, char **argv, char **envp) } break; #endif - case QEMU_OPTION_audio_help: - audio_legacy_help(); - exit (0); - break; case QEMU_OPTION_audiodev: audio_parse_option(optarg); break; --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650875303592444.0560830449218; Mon, 25 Apr 2022 01:28:23 -0700 (PDT) Received: from localhost ([::1]:47322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niu4t-0000zA-Oe for importer2@patchew.org; Mon, 25 Apr 2022 04:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu06-0006UP-FW for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu01-0002fM-PX for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:23:18 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-49-S4_3_mvePVOx_-zZ9fpZNA-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wm1-f69.google.com with SMTP id m125-20020a1c2683000000b00391893a2febso6461316wmm.4 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z7-20020a7bc7c7000000b0038eaf85b0absm8065953wmk.20.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 99E2967B1B66; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hI7bzsmky1WaiM9g+64rTyViI5OA6WYELvRET0z3sHg=; b=E1AmNwP1bR58CRtLy4uMz/ni+1rgsUQwTcIC4xTDIuCzoI98+Jb8zHAJrtO4GZe1DoM+Yn SF9CDd8WzZ0sxpHxhQbwlqJWH64ZprCcr0vOCEwb+z2+SQIcSijthVY5wT/kOUc09/8Zz/ MW5Hpl1ey/dM5TgPHt5EiZEv+rzsNAA= X-MC-Unique: S4_3_mvePVOx_-zZ9fpZNA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hI7bzsmky1WaiM9g+64rTyViI5OA6WYELvRET0z3sHg=; b=rN476h4TpC7ATqFfm7kyibfCV4wcqUzXFvA0Qc8UaXbLcBbUTPuDiGIZ3HpQbw1L+M scVu0lQG5kum9M2j2+iq7LZZ/WPXcDX1lT9jm/J/dviENq1xZ1JLGp2KbH4yJKFGuZGG Jp9pX8bdlQDoXlBkFTOKTBEAwfarpbImQiGg3WRp/yq1kOCTf7TB0xxzomWNDswG2dP1 Cjb/zzWLpnKjkuTLsxfbXvKKqroNAhaygjsBt/8lu/4T1rszsQ0mwPT6SvVM2RD5EPmJ ynkpz/N8SXpFypctv23ZAUaZuZ6zz+p3TP5G0USL4HRgMpWtfrnAk7rVJ6oAz6Zy901V 9TsA== X-Gm-Message-State: AOAM530Xd7WjO2PvfneSD0c3J9KGl1cg2Nl2Nb/3Nn0WHYgEtvKV80ZL a5s6sETV+WV7m/j3YnTwXXcaeC/dd18CCgnrOYparMm9Ft6UxBuHwsrudsnqM0ZlJ3SsOYoZgzB i582nWiFov9Z5GfI= X-Received: by 2002:a05:6000:1e0a:b0:20a:be21:a20 with SMTP id bj10-20020a0560001e0a00b0020abe210a20mr13322002wrb.214.1650874926593; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHxLb1ml4Gw6ml6BSzUinBuwuxXjCE8aateQTla9rtNcglW4bqzlgWY0sQ5Y0KtT9KHds1jw== X-Received: by 2002:a05:6000:1e0a:b0:20a:be21:a20 with SMTP id bj10-20020a0560001e0a00b0020abe210a20mr13321970wrb.214.1650874926384; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 17/18] audio: Remove unused can_be_default Date: Mon, 25 Apr 2022 10:22:00 +0200 Message-Id: <31616bc6be45ba26e96beb54f7278d618f15a5fe.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650875343380100001 Content-Type: text/plain; charset="utf-8" Since there is no fallback mechanism and default-guessing this is now not used and can be safely removed. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 --- audio/alsaaudio.c | 1 - audio/audio_int.h | 1 - audio/coreaudio.m | 1 - audio/dbusaudio.c | 1 - audio/dsoundaudio.c | 1 - audio/jackaudio.c | 1 - audio/noaudio.c | 1 - audio/ossaudio.c | 1 - audio/paaudio.c | 1 - audio/sdlaudio.c | 1 - audio/wavaudio.c | 1 - 11 files changed, 11 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 4a61378cd757..edbee63f97c5 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -933,7 +933,6 @@ static struct audio_driver alsa_audio_driver =3D { .init =3D alsa_audio_init, .fini =3D alsa_audio_fini, .pcm_ops =3D &alsa_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (ALSAVoiceOut), diff --git a/audio/audio_int.h b/audio/audio_int.h index 2a6914d2aa65..082b13247657 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -148,7 +148,6 @@ struct audio_driver { void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger); #endif struct audio_pcm_ops *pcm_ops; - int can_be_default; int max_voices_out; int max_voices_in; int voice_size_out; diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 4695291621a3..e5612138a74b 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -673,7 +673,6 @@ static void coreaudio_audio_fini (void *opaque) .init =3D coreaudio_audio_init, .fini =3D coreaudio_audio_fini, .pcm_ops =3D &coreaudio_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D 1, .max_voices_in =3D 0, .voice_size_out =3D sizeof (coreaudioVoiceOut), diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index a3d656d3b017..bbcad7051413 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -638,7 +638,6 @@ static struct audio_driver dbus_audio_driver =3D { .fini =3D dbus_audio_fini, .set_dbus_server =3D dbus_audio_set_server, .pcm_ops =3D &dbus_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(DBusVoiceOut), diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 3fb67ec3eed4..311e34218465 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -721,7 +721,6 @@ static struct audio_driver dsound_audio_driver =3D { .init =3D dsound_audio_init, .fini =3D dsound_audio_fini, .pcm_ops =3D &dsound_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D 1, .voice_size_out =3D sizeof (DSoundVoiceOut), diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 5bdf3d7a78d6..fd2d2fd5acb7 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -669,7 +669,6 @@ static struct audio_driver jack_driver =3D { .init =3D qjack_init, .fini =3D qjack_fini, .pcm_ops =3D &jack_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(QJackOut), diff --git a/audio/noaudio.c b/audio/noaudio.c index 84a6bfbb1c87..111aef4a24ce 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -135,7 +135,6 @@ static struct audio_driver no_audio_driver =3D { .init =3D no_audio_init, .fini =3D no_audio_fini, .pcm_ops =3D &no_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (NoVoiceOut), diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 8e075edb70d6..31b582e8e4b5 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -781,7 +781,6 @@ static struct audio_driver oss_audio_driver =3D { .init =3D oss_audio_init, .fini =3D oss_audio_fini, .pcm_ops =3D &oss_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (OSSVoiceOut), diff --git a/audio/paaudio.c b/audio/paaudio.c index e91116f2396c..38f09017eb96 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -928,7 +928,6 @@ static struct audio_driver pa_audio_driver =3D { .init =3D qpa_audio_init, .fini =3D qpa_audio_fini, .pcm_ops =3D &qpa_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (PAVoiceOut), diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 68a237b76b45..5177e31d9b4a 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -493,7 +493,6 @@ static struct audio_driver sdl_audio_driver =3D { .init =3D sdl_audio_init, .fini =3D sdl_audio_fini, .pcm_ops =3D &sdl_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(SDLVoiceOut), diff --git a/audio/wavaudio.c b/audio/wavaudio.c index ac666335c783..4e176500fc92 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -208,7 +208,6 @@ static struct audio_driver wav_audio_driver =3D { .init =3D wav_audio_init, .fini =3D wav_audio_fini, .pcm_ops =3D &wav_pcm_ops, - .can_be_default =3D 0, .max_voices_out =3D 1, .max_voices_in =3D 0, .voice_size_out =3D sizeof (WAVVoiceOut), --=20 2.35.1 From nobody Fri Apr 19 19:45:56 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650877688659875.6105412321475; Mon, 25 Apr 2022 02:08:08 -0700 (PDT) Received: from localhost ([::1]:41160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niuhT-0002Qj-8t for importer2@patchew.org; Mon, 25 Apr 2022 05:08:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0r-0007KX-3P for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niu0p-0002rL-32 for qemu-devel@nongnu.org; Mon, 25 Apr 2022 04:24:04 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-442-hED7U5QHNemqZWm8fXi9OA-1; Mon, 25 Apr 2022 04:22:08 -0400 Received: by mail-wm1-f69.google.com with SMTP id g13-20020a1c4e0d000000b0038eba16aa46so6862150wmh.7 for ; Mon, 25 Apr 2022 01:22:07 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id d2-20020a056000186200b0020a7be3f1d2sm9949427wri.53.2022.04.25.01.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:05 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 9C2A067B1B67; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650875042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s9HfXFFqm8XD3sd/B71lxNFxNbf5q88arJTDKzK7o3M=; b=WSX/WBoyT49aM7NxGWaYTwWRcCKJn0Hsu8VNQz3oFBcTox2mhtg/6l4INFWnNeaceXPAQB NQhBRU6Iu4DJ8f/KtvkG5hZTX9XyK8da7FA7hR4yJKdd3i78ulq7TN6ETE0QfBaYTQ6rRU In0QEOpnDjCKflcwK4W6gwUqiKvJ/zU= X-MC-Unique: hED7U5QHNemqZWm8fXi9OA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s9HfXFFqm8XD3sd/B71lxNFxNbf5q88arJTDKzK7o3M=; b=CPM7/6+1AdlV9KdMDHW1/x5YxM0YC1nZmKoQFMZ97xT5pF2qmAqnC15nogF4Gierzg +BNpuPgjizVtQ8nBfY1AqeNN+LGWqI/I/EfNbReFhwIHOatebBYP86i0dbjgFNoezlDf cqNO4QiYok+TkGS4e9MEPhR+Pj2cjJQ3NaF13cG181Un9pyfe4BNlSPsuH4MUEXortIz si3W3E4NtU3EKValZp37qpFTLsEOh/yTpaJ8Mn+i1bxAUK4QAdVTU6XX8RDRBKWQUU5o QRmzZh+H3HwV9rjxlwwyCbNPxTePtAX8mdQqKZMowswcQRum+XK7N7dekNK9I4Z0i4VK CX0w== X-Gm-Message-State: AOAM530SQVp87RYT9Buj/hvCrDQn1rD1rXB2bepeQwoMQrt6oZVwWYo0 k+bvairX15e0iLPt2H17smam9T9CvNmPGN4zfiOBi6gcNQlS5hxadrAP2bLyhbbDPIHsW1GD2ig BhJn/MX/SSBSrmFA= X-Received: by 2002:a05:600c:500c:b0:392:b12f:40a with SMTP id n12-20020a05600c500c00b00392b12f040amr15318845wmr.122.1650874926858; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLFvk5nzTaC2g1M8XY2wI8/zxlrWzXYrheN/6UUX0J7RkRiN+T145v3db5tf+iW6dHFnb7Eg== X-Received: by 2002:a05:600c:500c:b0:392:b12f:40a with SMTP id n12-20020a05600c500c00b00392b12f040amr15318821wmr.122.1650874926684; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 18/18] audio/spiceaudio: Fail initialisation when not using spice Date: Mon, 25 Apr 2022 10:22:01 +0200 Message-Id: <5db1fdef0330f20ed6ae306b5a71dad1b5e9b44c.1650874791.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mkletzan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650877715822100001 Content-Type: text/plain; charset="utf-8" The caller would already fail, but this way the message can better express the reason for the failure. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2043498 Signed-off-by: Martin Kletzander --- audio/spiceaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index a8d370fe6f31..fdbd7dc285ad 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -74,8 +74,9 @@ static const SpiceRecordInterface record_sif =3D { static void *spice_audio_init(Audiodev *dev) { if (!using_spice) { - return NULL; + error_setg(&error_fatal, "Cannot use spice audio without -spice"); } + return &spice_audio_init; } =20 --=20 2.35.1