From nobody Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874938; cv=none; d=zohomail.com; s=zohoarc; b=oLjv2oAVAyjlYB0jyVzPLZ1Qv2sWwJsf82vwEanO1vC9PfFB3kznuK1UpXPNPFQMDrXvoJLZM9/VcAJiXRcbyEsaWn7gJ5Q2bPVT7fwnt7y+Wo2GPF4bQb4surxSQvmYGksZICbb/3PeDX04Ih3iEAzbE4MYtKeazcu2ZnTOhFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874938; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CCG6lGxpSFBkTA/SRjKupJwKzVuo/aed5sg+24tDo9Y=; b=GeK0Yhow6KYJq8dpMW/4fye6b6IjWgxoNAROvnlfZePlHpZ1cxQq5GDEq83WbIYeWu1NEXCWZozijoVGXZqgbGCAYZFprcYOrz7YxrHtk5ByguAREA1RiQc63ttQ1ge0GML1yS3keqcUJiJmsqNq2e1fUhAdoUS6KJZqp9p9o2k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874938727454.3291137636028; Mon, 25 Apr 2022 01:22:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-629-WQcsx3b6M_69X3GJWrgh8w-1; Mon, 25 Apr 2022 04:22:12 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA63980418E; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B387AC44AE4; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CC28F194036E; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 159A31947BBE for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EAA83404776F; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E65FA404E4AF for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4B86811E80 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) 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-108-Y0Ysb-xGPFKBIu4LrFaNIg-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f71.google.com with SMTP id i131-20020a1c3b89000000b00392b57fbdaaso6445313wma.0 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=1650874937; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CCG6lGxpSFBkTA/SRjKupJwKzVuo/aed5sg+24tDo9Y=; b=ZswOQGAsIVNy+uHqoHLbSFY003oIQ7GSBufvXSWEu5DEpMEMMsMWyiEqRPLWXiez35HUhf YnVJTqze5mA1Z1R5QGE4+Kgtj+pj2fqB5ullLQF+oZHkMrL32Wc+CFoz/YpzNUefUoSCC7 7BcMW37arzVW4Nmdql7bUIp/LX6Q1Rk= X-MC-Unique: WQcsx3b6M_69X3GJWrgh8w-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Y0Ysb-xGPFKBIu4LrFaNIg-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=bRuUKqZgpuGiyXzkHA1Zu0JotrYaoG+4JOooJv6YIJRIxoG3O8Eoeq4+2SNa+c7j6r X8JtHLqfzpdkcqsf2vDcn9MlvV097EgpwZmDBpRhJH6OcxTJeBN8auS87Apo75PwKuhp dZaqvbl7p8PhCDnLQcrG5MKgcpI097DVOPvNb1GQgPIDh6WqA5aTDPl2IT9k7E6hVsw/ sQiagJ39xvPzb0XShRFyD2NyO98ioo/lsKzQykVzrHk26upD91MVSYy1fxJOXEtqCwPQ pO57WSoFTcdoxbDXdxcr3VEjk1pYoumSrT/0CeX3+xSXb2Gl+mVU1E3PAenKBjcuDJJc IMQw== X-Gm-Message-State: AOAM530cC4wTY2/S8+V9VaVgq3J8FGDkkn3Z2gq9MVHDUpuRBXTM9eGO UtUwv0/WxAPZwtx0rFN5dU0hqzQbIfB8kXAAW4K0H/JB+0bo8OpP21NyDWMfjJY/zMxhkTyzEu7 /9pUm98aRJ4p7Pnl6OG8= X-Received: by 2002:a05:6000:502:b0:20a:d9d2:ccea with SMTP id a2-20020a056000050200b0020ad9d2cceamr3777302wrf.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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874971769100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874989; cv=none; d=zohomail.com; s=zohoarc; b=Rz5wMWJFpNkrOd5oqzSe/TzAdNzxemQfeTOZ+2gFjZfsUQLk+8Y6/t+ofUZrjhS+ocyHzJagjKCibsVMs82R668og5WjJO2BDLfGig/N7ceCt6IW8ws5lRq1r2oU26HunKHrNpFnhYVaOc9fesR8VfRnTHsjfoSDNrs8koQDxag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874989; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lGr5ZYYCfBjIhbaCs5pjlimDwxXJN466WQPA6PrOrAg=; b=KNF/4kY1YeHd1+/gCglyqStoKqDYRGiCNSqUiSipyVCXuConA2LJLUVN98BGCX1MTk4Qlm5HvZiZJ0zdWfUq3TCFt7xxsA0rL0SsbrO6aMWrdV5qEgQ4bIYqino/u/bPwe78+FZmHxldYe6ZGbKbPEjhq1K/lPJWHtL1xgKSckg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874989374736.1756921709533; Mon, 25 Apr 2022 01:23:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-135-QGtu_ZRHOJuaFpMGYa8E_A-1; Mon, 25 Apr 2022 04:22:24 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 438551C068CD; Mon, 25 Apr 2022 08:22:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 262261468956; Mon, 25 Apr 2022 08:22:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A9541940353; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 164A8194037A for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 031C3C28117; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F38AEC28115 for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D7C0829AB44F for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-m-G1qydZOPW7sZSHL-N2rg-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f70.google.com with SMTP id d6-20020a05600c34c600b0039296a2ac7cso6875572wmq.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 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=1650874988; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lGr5ZYYCfBjIhbaCs5pjlimDwxXJN466WQPA6PrOrAg=; b=MHNov4V2AB4IsA43r6n2CnRFOTh4USoVd40YSSJOV7wyLmY7pYGoxlMn99LRGDve6ZN6vs sD3sAKLRhEHXZ6Hfyt5HrJRx6Bw7tON+SXueQJSYwjg8TXTC8NLQkmNyXwrbqq2VCJdyVK YqChZJLBmYOkDUZQ5zDS6xbrCr37ccg= X-MC-Unique: QGtu_ZRHOJuaFpMGYa8E_A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: m-G1qydZOPW7sZSHL-N2rg-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=1shLWOjl1FoELUCHLh59uwZFoU9KKzNeEzrlASigNO9c4b6mqPtni7CeVtOIVMzKgl tCpIluz3+k0+m5A60ssrh/4LUfJq6nHCi9WKxhIGpU9uGPNxRTwS0jEDZ129f18i+T7C nj8t8XbUpa570SxT3bwAB83puzgvXfcarYaIUdKxiTj2YGeTIlpKhZOJ9Q68jfy7a1d+ 3sKQ39SOa8hiqJw3OKhB6M1Hm8N2SekzXsN5VxEkFnXI3p4Ah/Maoo26cQBYsNKCnvB+ MDe/8IDwJWbrNmC3+OaSB1q8P+JUNbhxxyh21tFtQjBS8a5GFXf35dEINZROrg6Zio5h vW4A== X-Gm-Message-State: AOAM5315cat5HuwhN4W6pJty1i5RTb7vriWRnAXQNMDW89U1xzuc4yym h3kOEfHYOHmhXDXHotTO9y5xLpr9Aeq0pVnCxwrweEdipiwJVIekbPfq7NEqys24ySTqSvOaI7Y nUG08s6Gxht0A+Qi2HT0= X-Received: by 2002:a05:600c:1552:b0:38e:c7a4:f056 with SMTP id f18-20020a05600c155200b0038ec7a4f056mr24931328wmg.183.1650874923824; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874990541100013 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874984; cv=none; d=zohomail.com; s=zohoarc; b=NYvw+9sW4QgDuxD3IZcODziydCvKx011W7nw3r0Pf85C5YaLtHo9an2ZgAc//jppXzXV6dKiGlJXq0E+/nRBJjRZ6NqoS7sIGmoaFCQ5VZqP6+tJy4s9ZFYowBSq3HIec3Quw/dMhMQL5dLdvJVwdb/NTYivGn2a2xTmuRk5Tq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874984; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O++t1zATSSDRwugsXR7Q5IVUhnhLz0oadJiOZXGBQI8=; b=YN9mkqYwyP+cD3w8HV8XTMwHuCtWFJOHQCJOSmqZP5irDHWeIFNIHd3GJFEtKt1dBXHonvYUXM0SXRaBdwRmOevdFIogWZjEVnGJIgdJfEL5Sd6ESNmS3lYPtk9TQpJSJJfuQ1xeXGOuHm8R+fXLuKp5W/m9fEr9aa4cHS5rEFM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874984033178.66499581832875; Mon, 25 Apr 2022 01:23:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-AVWp5vHqN6Ge6ruig8GYLQ-1; Mon, 25 Apr 2022 04:22:22 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E96B0833968; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D671442B93B; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E45F11940371; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3FA6E1947BBD for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 33497C28117; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F743C28115 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1582083396D for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) 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-36-ehfBWJ0VOL-Z8vV8F0KEsg-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f69.google.com with SMTP id i131-20020a1c3b89000000b00392b57fbdaaso6445307wma.0 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=1650874982; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=O++t1zATSSDRwugsXR7Q5IVUhnhLz0oadJiOZXGBQI8=; b=YxHUIvXhRLkPSu+D6tD2Jn3Tiv+CfXSg3snI3xgfGyQuRqW1L20GrGSCzDl+zY4GP6L1iB Ezjht3G5+dwxaQKvA2Lukx0GfP8GM+fezBcub1t0ZFHfjKUo1aDLpN8J3N3Wx3KQWw0z9b cEse96U5O5AFTMEW4nz9/6D7Pj7EA/Q= X-MC-Unique: AVWp5vHqN6Ge6ruig8GYLQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: ehfBWJ0VOL-Z8vV8F0KEsg-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=Zhjn3BKb6jAbAPNXOu2sYlfSv8oIskzG9m/yLgsBP7rsJ08xWzDVttu2IFGK7No00e FlC9Hwo6CWlsdv0DL4MI9CJcPvH8+rzlIUuMfPAApiA/P5GsUlm8/+KJ8XySSMqncN4H ecGv6adwofKJumI4uSx6Rc53OHIy6NGs6bGol7cszQE8cWD4oTiPKk7KU60bEW/4+lFn ivWlwh3VD0A0bv8Mwc1JCc+wLgUuhv7QpEiJWa++ZvK8WAG3SZKCO6DVENlcYP//lCQe +mRjoBYuTFuBhNNh8WwmOQLuvGNW5UkNTlT7ISQvU4BhBc1F4ruE41626hdRAT9mKb27 YLoA== X-Gm-Message-State: AOAM531MHlW2FpPJgELelVaR/hwDcEQuDZu1ngeUqGNDF/UBYJhteQOK KodEktPLPb73OVZcU5VnlQcG+jKv+wqjLxHcPxkxFqFKrbHnAVWv3hjUMVv0LvkxNGWaW+s6Lo7 eOLcCXBXxVeUbM8jcb5c= X-Received: by 2002:a05:600c:34c4:b0:38e:b628:da95 with SMTP id d4-20020a05600c34c400b0038eb628da95mr15717844wmq.150.1650874924304; 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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874984762100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874940; cv=none; d=zohomail.com; s=zohoarc; b=Q2RNtMJR99iQnHQVVJEsdFfkWtl7B9ABgKU++FR+elY6EOXU8RE1ixKTV/7ocxLMJ5ullyo3D+MnjvMAWscLbnKN7cHmx765q+mVL4HLJXZYsWHF6TDWBKRswi2l8699Ej4YLONUklPd9dHaBoEwqb7uMqTN0OP++HB7sKnIJ60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874940; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LP+dkidDrA7cfJYHAisZQeWSrGU9PlpHAtpMlIl/SfU=; b=C16v4zE2eUKoShOXnHOnkQsDMdi0jej7Rf2yi5WInfg8R9ret4qQS4NeHiKl7aszuquVLFhyWfnyj4A+XAB46Wvh5adPmpg6JpKUpun+cVN93FUZCR9/+W7FetFnWxR8Js7JTtp59sZwM8MXlSImFMyyztlvP6lGgUXm7Y2y8Tc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874940329824.7865511300303; Mon, 25 Apr 2022 01:22:20 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-KmgOKRtSMEmrWduxvqd3Ig-1; Mon, 25 Apr 2022 04:22:12 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E58818E0052; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E8AA42B630; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 326021947BBE; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CD58C1947BBD for ; Mon, 25 Apr 2022 08:22:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BD67442B931; Mon, 25 Apr 2022 08:22:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B944042B630 for ; Mon, 25 Apr 2022 08:22:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0882101AA4D for ; Mon, 25 Apr 2022 08:22:06 +0000 (UTC) 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-184-dYMbDcnLPNeHRg9zcf5zTA-1; Mon, 25 Apr 2022 04:22:04 -0400 Received: by mail-wr1-f71.google.com with SMTP id g7-20020adfbc87000000b0020ac76d254bso1751669wrh.6 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=1650874938; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LP+dkidDrA7cfJYHAisZQeWSrGU9PlpHAtpMlIl/SfU=; b=HQpnv0liXRwF5iEtkgH+P6D/xhcpNeqCnTEsrkwGBMFzZhhMtax4BJX4ByKHnamQxtRKDO FPWb/TwH8xQuRsMBJAzEiNnk7BAZXvLWEIXBS9x6sSrTtHlaLq/kHZR59pqNTyvayaIB8S GdgdlEqhEIzvEM5HvYPrfNjOvjCM/FI= X-MC-Unique: KmgOKRtSMEmrWduxvqd3Ig-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: dYMbDcnLPNeHRg9zcf5zTA-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=3c1enhJhVsZwgi/V0hf+gQXieOW3ex7Bc4kV+/wK+Owk4fk2M0GKzv5tkkWIrRvHGe iGi1xSN42/BLPhIKWSRQuqf+9jNvuCYixck/z+gDIEwjOYzrxHT+4zwaFOzbdObvXOaR NDaDNrNI4Unka0u/wiqWE5ZAUhNF6BLwa1V2UZH3VfQINFdNfAF+FyHTgUe2MotuoJmZ Pi8QXohcPUKTyt+OjyyMXQEKu/gwwDtHqdz0Fcjv+Tvcogr8qNkPggz4uTEWEnZgtnq/ iNcJIMrr5W8vNIRmeKInI55l8S3pMt5+RGT1dD/pIRAw5y3HM6B4dJ7N661PmRPHlFxM nTQg== X-Gm-Message-State: AOAM530tDBq0jtX1Mi8bQm5YMNfM/vY8CV3pr0lYVbHtUejaj0igzhiP wgEu6zFeuDr5XSADhhbcZ8mFYo3uWaAPniZTWWtVBka0SYbdZiqxC6LXftet08qjxIjVha5O9X2 P08jcUJ1PxeBZ8zb2bS4= X-Received: by 2002:a7b:c155:0:b0:38e:b840:c99e with SMTP id z21-20020a7bc155000000b0038eb840c99emr24205893wmi.201.1650874923692; 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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874972235100003 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874982; cv=none; d=zohomail.com; s=zohoarc; b=h+fiETRvzhwkMEDYM95z8PKpTdZ7dELoiPDWoT/Q8PY8mAz5DUBk6Ojs+RkeJU2gdhZr1Aoh6HY2r+i9j835+NGjtE2xiLzrppY6joXD6xkp/DuDEuEXD1AVRPmj4uysnW9sGzwT25o/7r1uVOtU16NmEaYXLY7J4+MqdIhk89w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CxH74JGUW7ryvtn4xS8i28T7ZhqNwBVbzuWMzVW6NKE=; b=ECx6806V9vm7JBnRk0M1xFU8pK5S5wP5eoGZGGqQ96gTECZqRHeh7F98RsllyT8eLOVrBny7Tdc5DUTaicbRG1uIFS5fgC7H+Hwgk6dIxpuJ7xiXvLbiSMjI28KL7tAzmF4HmnKs1DDCYm9WpVYEuYx/qynQYQcigYeLGDGZ8Lk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874982944235.4728268920959; Mon, 25 Apr 2022 01:23:02 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-153-SdQpLcxOPo6U6P8t2tXsJg-1; Mon, 25 Apr 2022 04:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB0942811820; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 764571468956; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 037A11940365; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 40628194036F for ; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 24BCA7AF9; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCBF59E82 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20AC1383A5E5 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) 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-223-FQkgikLeOuW9ud-oL_5Nnw-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f69.google.com with SMTP id b12-20020a05600c4e0c00b003914432b970so6859656wmq.8 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=1650874982; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CxH74JGUW7ryvtn4xS8i28T7ZhqNwBVbzuWMzVW6NKE=; b=eVxhL01hzEI66pIZLxU4uG9Bf+hwBUSYMSShcl7YdPv7w5OlLiX1ViNzRXnzM/OWtpdf/l bkHj2Z0gLiZfxMDYhAoV0FH9BBxtLb1y6iJ6rfFueXkrfchjQHWPEdX1+/2m7+rK9KSJdt SlO/Hf6Bk2LXZXcPxn5e6B/iDMcbksE= X-MC-Unique: SdQpLcxOPo6U6P8t2tXsJg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: FQkgikLeOuW9ud-oL_5Nnw-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=ToIJ47krckpJvEZcfoMpV5UXaneKyuo1xEZ/S56xt/QK4IqEKr1tRQiuqZlwvABVYR IokgQd7O7TuwwctesVqBILWsFiysfs256F06cz3AOXbYQ7phgMkJrsz4oNVYmwHDJ31R s9TJaYbVp2PlOGxORIEcJGveTqBicYqHihLOdtdpLsM5ZSt+vTayAWOR2Wo4oGFiBEAu 4bY/6lotjPXN+sA4IzrlziEF1XWhblk1wSyQmviL0f+2WG8SaKU4/t2yfIeHVrg+xFYi fcEcDj95MydY9QvuLbSLedFHi8ximK6Yp9gQsREDrLDwg99A3CD/wKJYL7VEBY//blEC g73g== X-Gm-Message-State: AOAM530VpwiL//kCcdQLBe71XK1dSNwlCzDGbPHLgbrB9dY14A10rLw8 J2nPip0yp+qXnZqhsw4vGqL4aFwXsBEgNq9cjaSJsSeKYHd9ldmzIzEOny6lOm0s6WYfweX1/P/ 7KMiafXukgDH+cFvxtP4= X-Received: by 2002:a5d:598c:0:b0:20a:9194:22d4 with SMTP id n12-20020a5d598c000000b0020a919422d4mr13194365wri.124.1650874924648; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874984765100002 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650875043; cv=none; d=zohomail.com; s=zohoarc; b=MexA4C6cfhDi4wfkDQAvvFVSuAKtxkQJ744RPCsKc/tPrLtOnAIGQe7vU5hL9OLGGV7BlBWwUM2IthQvIHbnUpMDnsHBItCo4h0YL6FS3Y+bOf/nAWCfPyGlWzea3PiPeeKEMtnB2BvZDKChL/0auiTG3KIpJV4sptia1FeHED4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650875043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/07G+KOnjwzPWs5gbVSF2lCzR4/Df0FQ6EC3Xytgne8=; b=PuSsaOZ0SvIVpjzP0rZhImG1hN2KlnKTVSmB2C/sCox3zFuRt+XqATo/VQAu36ojQKbkLIOaKhLJ//x9BlNu5b0BH474/IAKsHugpQmuCxLk1ElPVvI4Uv9ovb2iN+Mcuxavd+V6NE4+snkFesfKQJj64VYcKutkhyeYJah7uXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650875043066604.9947022839386; Mon, 25 Apr 2022 01:24:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-RTqDxIsMMxWtAs5HoiUgIg-1; Mon, 25 Apr 2022 04:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DB9C0833976; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C608640D017A; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 36714194036D; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B0CD41947BBE for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 90C032024CD0; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C5972026609 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A31580352D for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) 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-300-2IwPohYBNgCLaT7iQd0Pdg-1; Mon, 25 Apr 2022 04:22:05 -0400 Received: by mail-wm1-f69.google.com with SMTP id k66-20020a1ca145000000b003928959f8efso5509975wme.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=1650875041; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/07G+KOnjwzPWs5gbVSF2lCzR4/Df0FQ6EC3Xytgne8=; b=OqiPVIDUwOM4fSllA2+df3RtlP7P04ZjTsWgnus7gnGpB+6kK8ZgQJ6KTs0IGRS2y6SQ/M x/PpPxvGVshZZp5Kfqi4bF0T+jiHbhhANZLBMYqOxki0hcsG2KW07v7ex4/wq0dHZ8HAES LQQIU+35rAY7kIvZwiV2AY5Sx8BB9A0= X-MC-Unique: RTqDxIsMMxWtAs5HoiUgIg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 2IwPohYBNgCLaT7iQd0Pdg-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=pFNhE7u14LvNG31ekcx1272mFJi6NgxnOFPb9MJuLNWn+4ymFfnJiLboWJCT4xx7O9 VQ3LFnmKdyMDsH/EpfJb3jS4ITdv2DFYhoN5JzJ3TVeN4rJIyLLPN5+V41le2pfGs17n ZP2FIdnDyTS8Y/jHwGcyKzIVNwI3SaswlHvkTLl14tnR8LJQPrGfZdweLk+VXXflaLjM DpSK4KITLitJTvOx9BtqgeqR+ZHX7w6ICfyxvgatevPJu4qfHrqKGB/4tZUQ/xfcINii JEHYYfl8ag9UgeuFIme6qZ02ap/Kx/t3AyOOus6e+k8zZeJK/IKc0FnJc9WQ0KuUpM5u 7d9Q== X-Gm-Message-State: AOAM530EYlP2x2Xly+x/BSfQLwAqtLj9AMtjemkhYnAmOzJ3if8/ZygF 6kq4/PuxKPlIVRJKzA05VvEBZAPIDnW5H1vbVy4C95DstgW1IMlkgA2cCWCGVbfPbV8p3KRR5so 8qzBg/Nme0O07ztg/4lQ= X-Received: by 2002:a05:600c:3b97:b0:393:ea66:77ef with SMTP id n23-20020a05600c3b9700b00393ea6677efmr5295103wms.120.1650874924774; 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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650875044894100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874942; cv=none; d=zohomail.com; s=zohoarc; b=RfpkeSKqFLEQO87us3PJonesNE7jvGzpBHeeLu3eHjcy1IZcJa+BidUzCffcm0H7tSUJF/ayqYGKLWaYtXemmu/htYlw7WSFzByjCz7iC/m5nkyloJO150OUnK1wN4q0dzoPrECnvtg3BVej/FMvZ5Rc8ZihBLeSanM2NJc/GgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874942; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=D0LFbNwDyRPW+zjlUP/d9r68JeqnGsGoh5YzkKYfFa7HW4eJ+46rJWG/fzSl6r1TfA72iXJfARHGg1zTtcYzHcxOVxXALvgt9X9/SqUAKncsjMU0LjGrcfMxPs30yO2jz7ICJL8/h6YtzYLryDNuGWOxc8/9RoQD2um29y5uX/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874942942512.1193339404067; Mon, 25 Apr 2022 01:22:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-0ZL-PKX8PMSFdLMD2Quj6Q-1; Mon, 25 Apr 2022 04:22:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D9B2811E76; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 290E040D0187; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DD32F1940355; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 931861947BBE for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 71A81C44AE8; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DC2CC44AF5 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51F513C021AD for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) 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-575-j7K960ycO2q3ihNzySoDWQ-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f70.google.com with SMTP id w4-20020adfbac4000000b0020acba4b779so1640358wrg.22 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 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=1650874942; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=H3qkY9n8fc4Vpk+4sOa2c/Q6beub+L7sfuev8d0Q8o14f5kGga7KWeR902ZCXPh9W2UqeH xUrCmby4HvR7nhhIOSgeS72XW9XhkbB3lZjmiKnSGGqawjG21ENAtRO420zGgAsd5cQ12V TxovftppW2cAm2kWaLUsi6fs+TH5II4= X-MC-Unique: 0ZL-PKX8PMSFdLMD2Quj6Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: j7K960ycO2q3ihNzySoDWQ-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=fQUn/A/vLJtrjc1rlQsneHKtZUsegSFiQl3iTCwmhb4iBw4LUzGdPq2tP86vaevGNq M+JQKqVU8ASB4h3lYoVj4/g5LvJ9Hn44UQpp58AE9AIul33dgj+EtfG+hn10OLBSXf9g yWEEHkEi/WtXuk+x6VL6GQCM1/VKd9e41L1C+p7BGUWwclQJ79o+sZXPKLeTzf3J/J8L NzWuI+Bggo/djGiT7wJ2UFE6Z35dVrJhng3FYNu1OnpXS5JpzbG1OCnXUuJd5tnNTjgj qs4sqYxZ/jPfOvtgnnLKKnZTNDn04VTNNjuvXmfFdf+5S/R2Jocht9fKUYvH07NyQTPB HS2g== X-Gm-Message-State: AOAM531OH0HmsqGPMzvF1zaopURD3dTUCmQJ9gq/4cKRMzK75AszLifv SKn4CldIxQwVcYtxg2lXYXk1/wFwtn+ILv8QJz2SFsNLJX7iE4ZYyOGqogNBGGFkQrx2j4vGtcB Ssdo9e2pedJofG6AjruY= X-Received: by 2002:a7b:c8d5:0:b0:392:b12e:fd11 with SMTP id f21-20020a7bc8d5000000b00392b12efd11mr15517529wml.96.1650874925078; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874972717100005 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874946; cv=none; d=zohomail.com; s=zohoarc; b=HocSWyD+vlQNKLRtccAfaANydUkr8TTxxBxqIToHRTjW0aFLrck9KCgAdfgqsAm/RP+Y6BJg4hp/7QIMOTXhbo0L8uup+fB1LNZyrRnRAU3cZDJBWTrdp39xWJDjcAWB5lTBGUa5fFoSTXtmo0kpXGwD2cyu9PhBXu1heISndhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874946; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PAZUwc5ZqVj8eUHH2Oe1Tiz0RIqORJb8+QvvQ1BqMLI=; b=BjMmGOW6WMwj7s7ha6u8QarFhHSTZDa9j8pNoUo+dr1zEpKxoD6w899MM9Y7KCXg6XKBADBphPHEEa/4FPUG4imSll1tXYzQWT1nm8paD3rk4hD1SZVYEkz008/sQ951UNU03759HjOsEcoFp+YqH/qEmCFyr6COe1XEnAkcLOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874946433312.4081709777389; Mon, 25 Apr 2022 01:22:26 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-4lPjBJSUP4CuhHia4D7nfw-1; Mon, 25 Apr 2022 04:22:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 466B41C05EAA; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3245A40D0186; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6FDD01940373; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BEDAB194036C for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9E7BA40316B; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A86440314F for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7EACA29AB45A for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) 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-53-_b1yJ-5EN0KeiD-fHbYD3Q-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wm1-f72.google.com with SMTP id h65-20020a1c2144000000b0038e9ce3b29cso9970923wmh.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 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=1650874945; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PAZUwc5ZqVj8eUHH2Oe1Tiz0RIqORJb8+QvvQ1BqMLI=; b=RdDtYxFwUQ0JgL8kWcrZaoqlX28NFq8VdIkA7JgGWf8lrAsbmoqGU3eortQCN5GnAXQbDc +RSOB5xXmanXp9LqbLi9C3nOokcMowiHSLNwUD8PhE+gG1FG2+zGiHOpe7GyPfi1Duvwjg EMK0VUdLNdPqzlp/xYCAIOtYEI8485E= X-MC-Unique: 4lPjBJSUP4CuhHia4D7nfw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: _b1yJ-5EN0KeiD-fHbYD3Q-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=lTxD4TJiCNTcxixWQQiQ4eEow+BFX+EGwQFL3UA4APMbKvBgJ9Fpf9xjPw6sjExP+H gL2F+qW1GtucGV9QMncCZT+eCkttYA5FDcSz3FWb7gcqPjBkvwoZQiwPBd/JGPNBLINK iP7Z1g7AxHiPWn+WjqNykmoZarOWizYeVwcdHW2qn0vZL7eN1eFilkIfVvnByzZX4w7e 0ttrhm65lr4cFTcOoYMka/z+N4kOsJ6dfRv4h/q0UoJVz5g1fpxjWeTN/ox7Mlxc/Y5r fxWvKE4L3hjvApvsPXug+e7CziCxqXcB7JYlLEzVgh5cHhmwSyoJC+FVovyYhMPCm9fZ UfaA== X-Gm-Message-State: AOAM531DIqcFoegN1Lh6PfT3+wMZiaXeqb6gZrujw2nQh6f2tGVUgIa2 xKilVFR7h6HnGRen9X47krYes93K82VB+nVYzb/0NYOFqrxqkd/ChCnux5pVTjg7/bnhJ+VcR3A dvZse8YaOz9+tcQ48P9Q= X-Received: by 2002:a5d:47a4:0:b0:20a:c95e:b3f3 with SMTP id 4-20020a5d47a4000000b0020ac95eb3f3mr12086553wrb.663.1650874924929; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874973253100008 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874991; cv=none; d=zohomail.com; s=zohoarc; b=YTsM80x+4VLl7fojrK/oKfF8suqy7sVlpzlvsli8yd559SQMJ7hhKJkdfXAMrZ/yMQKbek+/Pc4obDCFOq2eHtVcGLJ0i8p03xWlZQYrP2KeHXiJst1JgrBKG96iLmDmcZa7JsrJEw3dLLmbBm/ow7wYk/LDfi2Kyh9kFM3G57c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gedXaEU9mdSzLcQUY6OVe9Xoeu9dbw5uLfUiFLxMZHc=; b=S8CeNsVDECanDKEnDD4tSM81Mwkl8FyBpdLj6iRZ+A2zz1d8v60Whp1TfJ7WpNiR9WJX8AXcENRddYwtpb2RqWr4OxwE2RLOWyh/cuXOuUr3qeXH2uUzHSt5FFI5/VQI9S0c4e/iaMK1poTdysBpIBtAUpGbaq5QH+qq0roXYNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874991101786.055129259373; Mon, 25 Apr 2022 01:23:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-202-i_YB8Bu4Mpa9AWOqnVwREw-1; Mon, 25 Apr 2022 04:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79805185A7A4; Mon, 25 Apr 2022 08:22:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65109404E4AF; Mon, 25 Apr 2022 08:22:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9D7B9194037A; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B71541940355 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A85C440D0188; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A450D40D0187 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 825C13C021B3 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) 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-613-bxYsG-KWMrOD6iWZy5p19w-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f71.google.com with SMTP id y13-20020adfc7cd000000b0020ac7c7bf2eso1724711wrg.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 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=1650874990; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gedXaEU9mdSzLcQUY6OVe9Xoeu9dbw5uLfUiFLxMZHc=; b=IM78PEvHInAfGcjl2daisN4HU2GOQxkL0+4g+rg7uAdGRCsVX8NVTxuIkUOu1i053xWVsY FoJtoTh8WaOP59L6hdcuvMNAR3pmRDGL/fO3K7hfJx73hjpSOZbWplz8Kzd9cCm0AmaA1C RR9/BrShipdeSa/CuqovCuUb6njeYXw= X-MC-Unique: i_YB8Bu4Mpa9AWOqnVwREw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: bxYsG-KWMrOD6iWZy5p19w-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=OMplnFr2UVgnKkCxK5TH6h4Fs/2LZeCxugKVOjma6kxnmL6Nb0j2IYvxuDmBn+xk22 usia8XovsFg6f+UhxWpT4cMWMOSYW54dUzPm2MexrG6IPkIo2QULFZavq+XpZoLW75wP eRTuUSMTOeA4k0vP0QeFADm8iUICbjiRTcrxkLkEX0L7q+N4WmK4M2kFc56R38seC/aI p9X3+Q2V8ZTZynLv/n2CcMxAAizUCNRDRpcpPtIy52fZJ3Hpbj5BciUWHABH/d0AhDFf yXgNaO43ALQgg8QrpxSHlFLhKgB5T6XNyLKAXMZx8sBaa5qT8BJLmVlOU15gRnpDeEjn DQng== X-Gm-Message-State: AOAM5303JkIymTy/g2beYIWUJ73H2DoJ09aZRHwqUPGpGMw8IcXnrV2i zsfGMrO581n65w5QQb1tLLsgUroJlMZ9aoBD2sNR4s7zctBK6k4DoVMqIsZhlvaVmDGPIplYWgm IwzA63fwPihwE13ZfB/o= X-Received: by 2002:a5d:64e4:0:b0:20a:e005:cc96 with SMTP id g4-20020a5d64e4000000b0020ae005cc96mr708553wri.402.1650874925645; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874992520100015 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874986; cv=none; d=zohomail.com; s=zohoarc; b=bhc5vJKZVQI0DeKKZgO6CwCK4BYfj8jsAAAHVfJBpJxhajt5FO1lfgJgLF0n7QYr8bWlh6GL1Rnb4acQ9a+fE2syT0jMReJ+FSg6dQSWKoZJo2gKxqa5yf0EF2VTK/ns98g6lMw9L3t1lStBq4Ynr2IV0NjLqf1WMMKQRNxXWGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874986; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u73kz9B6wJ0lq4eD98kOBj7vDwMC85uO0URBzEu5tl8=; b=j59MwmbRO4WK4vlfm8KphtoMqhAg5ckQq8CzIUb8VeHr1o/qsY66Zgu9FF2tGabXuhzTvc8aY7mfDJBhwZAUrrzB62OYoAuRjwuDZrgDfy5U1Enw1UQ0n4tW+CdJYCwe8eza49Yc27LfGchA/HNNaHSlbITgPRix5vtaSMJK0oo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874986904952.2780908694037; Mon, 25 Apr 2022 01:23:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-4EE8c5_xOQ-tLB7P8fnRZw-1; Mon, 25 Apr 2022 04:22:18 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E6F43C01D9F; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AB9A42B630; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7505A193F6E7; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 148261947BBD for ; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0610EC28117; Mon, 25 Apr 2022 08:22:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0216DC28115 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DBBD9833968 for ; Mon, 25 Apr 2022 08:22:07 +0000 (UTC) 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-577-0_pgHKZIPieACN9nLdO6TA-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f72.google.com with SMTP id l11-20020adfc78b000000b0020abc1ce7e4so2424210wrg.1 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=1650874985; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=u73kz9B6wJ0lq4eD98kOBj7vDwMC85uO0URBzEu5tl8=; b=LqO1KAEa70Y0Z4SDk8fKjQYGjloldSHecoCI/RKigKz3FkAjZxD9xfOy242ZviuWM5oeKr qQNzDstWXszg3Rr9WnIIp2OpQty0sbjA7LziHdGwGwD9/ygTpZXWRNDIx7RwJEA/xZ1UyI KkvqRwDSAXk9xcZSsKMqpScsLch13o4= X-MC-Unique: 4EE8c5_xOQ-tLB7P8fnRZw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 0_pgHKZIPieACN9nLdO6TA-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=FdAgombOFuSDInsQY3987sARLQVNXaeDU40p1F1RwzZ8Qr7CohlPSF4zjSvsQgWajs fiyg5nayfrHmhv61Si1knsGk2cyJYt/S5rGjgT1Yh82sIs+kaXxK3DQHc2shqF+BREhX aifnKt8Ne/FXz0J5EilJD2JMNrjF/W/bQ5/DP+nAoDyV92x8bHqj2AfD0p/GiyqEU696 kgEN5yaLicEVKU9amOlCNPGjmOf0MzCM7SacjyG/GDHCqhqBzmVljj4+PT2mmPFGmbOV EunO4MdKOIO6badVXWwmDoJnUYfC+YBeew5OvperAXEjmg2pwFVEiyVzkuyHOyHgNdvp 9IVw== X-Gm-Message-State: AOAM531y9UsAHnsqvYZ9ci/v1Pn7ywzU4zNFeioIdJRbxVF9Kw5GlQ1Z TYVbduWfm7rLKQE+QrBTbvAQD8utKMkaE/48rxqEd+18sgMVMNQhgLKNbp/lSM+76q47wpX3YsG GNfGPpbbADzI1X/8XXPw= X-Received: by 2002:a5d:50c4:0:b0:20a:c547:454a with SMTP id f4-20020a5d50c4000000b0020ac547454amr13706723wrt.16.1650874925385; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874988514100009 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874945; cv=none; d=zohomail.com; s=zohoarc; b=DCIDQcQZXvxl5B8F+EG83DKw9vV/Q6YmUqWxdspilpCVJ1SQIqBp+3l05eYmGw3Ams/uWQ8CceCrd2DmIv+jOtLR/XROadIdzUZW/aeVE6rIsdxIlJVXgNhnPSTxOy7tboa0522dQIpyUAZJ0PgVKxnYVDeQmLnasYqy5GAneLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874945; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=nn6DavFABQY4Vra2udH1Cw2CGFX1Gnn+Pa0ju8O1Vfm77EX/fpedSOKtT43o5Z40XcKHlBcaPBSlpGI/92d0nDdvee4oGNOh8b6z8DY73if0Jw8fMSOAW0g77+V1bLX82At1IkGpdHPs9lLAVmUM5Z9KfTNqjSMJHtYFAyGyIzQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874945472113.54587298012052; Mon, 25 Apr 2022 01:22:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-bqs9olulPt6dwJNY__nOxQ-1; Mon, 25 Apr 2022 04:22:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 571931014A79; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3319F1468F35; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 39C871947BBE; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ED20C1940358 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E9B5F40316B; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5909403156 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C52EA811E78 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-91-t-Ioje2nPx6-QcMZ4lCzpA-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wm1-f70.google.com with SMTP id v191-20020a1cacc8000000b0038ce818d2efso6472533wme.1 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=1650874944; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=FD0JSy2S84KO5cp9lJsTV4u9sqY8bV6OdeNE+UCejygBSjHcFcDw5XGpVQ4yK4E/j1impN qGeiPAGoJDq6GTx9MrKB8xrsPs0luTTuN8BdpULusjoYAbZe66MKNI+gYn3tm4hul31qQx 5adHxs5AKZVfNrSN/fEChWk+8eZ5WnI= X-MC-Unique: bqs9olulPt6dwJNY__nOxQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: t-Ioje2nPx6-QcMZ4lCzpA-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=i2A8gqjt+O+5ahl53cuWZ6J+BoWF6QarYNOxtKroWHBglDBszFWvqj5cLNIr3w2W+e p3VkR0JI2WVzczcuHiecw1gzQDh4AaKg/Sb7FUUUKQjytbkEc4Pky63/PyNk1Z8xWFl+ 5Inm8ndzUbH3kTssG3HODzmWnR5droRefPRZrjODf4TiJJhNtfPEU1sq5Fu1Dj10EMSD LjvQ8OzzbYuGg4rWWqCdoi4Nw/8nzlC3d6N0ZPHmKDx4oZxz6wPQceNED3XITXQ6lJv4 CYCHMidI/Rp1YXY6YNFVqqnASQ7P69nLkyXuMBMHdHvw2OILHyu0huCNhEMvXGA2dWoV C1Sg== X-Gm-Message-State: AOAM532CJcFx4AQbgTbjIR0+aezYV/XWAkE4eQjs4mWwkurja9xppGq1 6aE3jqb1qwUlXDuJc7Cro0Klp2iV3s8gv7Bfw0x/81ktNiwp91oxiVP4/KroadVKsQK0cs6Mk/7 k2rHKQFJTD0aQjkUWmiA= X-Received: by 2002:a05:600c:1f0f:b0:38e:c9c8:9983 with SMTP id bd15-20020a05600c1f0f00b0038ec9c89983mr15260371wmb.105.1650874925591; 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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874972967100006 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874995; cv=none; d=zohomail.com; s=zohoarc; b=XKKAKAnCo2P14dQWhOkrBlH7kvlji35O4wMrJ8oWcY7jcfaT5x8oWb+8i74D8Z/tu/mNp0amX5lHhhgFPglGegVtuE7tjF+xVK2Fzsl/gd8MzhqUf00ybth+R1pSIX9uYmIa6KVR/ugLhlFcAdoLKuGCNyR0OcsYRo+KKtGB89I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874995; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bwBj2TaBRASZZSGjsc9HqXLMt7MyjxjnAoNllDw6MNM=; b=QUu3zjEatERzjV8hMzkxtPmCcFWx8cCPn7nNxOxTGE24ig3lqEUX537Yp3pQBU2wUdLiezr4jRa+e7Haaea5Pyc1xDoOS1edL7xU8tVJjTtFILOBCEHyE6177SOn8B7nllSPfcGb09SLFnM8xqzHpJwbjo1csz12tDlA15WfACg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874995618213.46955544905154; Mon, 25 Apr 2022 01:23:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-3SVikKFHPvG_AkFnP-kzvg-1; Mon, 25 Apr 2022 04:22:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E66D18E52A5; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08DAFC44CC2; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9E5DB193F50C; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A54391940352 for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 789B342B939; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 750A742B931 for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BD73805F6D for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) 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-227-6MpJ_xTFNhi4XT594WegkA-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wr1-f72.google.com with SMTP id s14-20020adfa28e000000b0020ac7532f08so1766552wra.15 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=1650874994; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bwBj2TaBRASZZSGjsc9HqXLMt7MyjxjnAoNllDw6MNM=; b=cYysisP1dQ/LCk/V1cT77gAUfgLwTx4xVISMCeyrtM3Tj78d462dy0jTVzN18X3mmLEzzk iH5d2lPttsXT2ZDOfyxLlw7ek4wItabemKXP0AC3rvxjXij73w6D0oSZ3ErkR8n5bd4Wis rsuPEDJ1coOfW8LPYazJH9iXscJzQoo= X-MC-Unique: 3SVikKFHPvG_AkFnP-kzvg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 6MpJ_xTFNhi4XT594WegkA-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=xINzsutc8q5M+5WGmtKFX12b4gJWRwKZlq12RgHNfqoQDOeUrG/R8H/cTSLRrL2dDw P8AaAjzIx5QHSFdvGzw87XUI4uX4BPFBH9/73W3kODOu8PRFv9TfyrfmF7XWOG6sODPZ /My/0XXdrKJjvMjz3Y5p++1jwZ7Ue+YH3LmFZwsgtPQ996vCK+BM6wuVXxh7SqZh+UTU bZ6aZ4i0G/ksD/QZ6H6uuMNk8ByUxx9JLlBGnEd1YfENBefqzGdjmBPNYfTolMKVxRmN I3K5pqHVIxz9Kz2B6XtZSmEulBcPlcWHecyKAQE8zCXMMfdzMCC6ta+eBOGfBrgcL89w M6gQ== X-Gm-Message-State: AOAM531BVVoA2dnBqtS7Gnn9cQzZZ9exBAMVq+AS6CbHTIvMDcWtlSiI GxCAb3golB5ZnJ/qi9bjjzt37CzQHEZxuLALAXF6KJ+a+qujEbQMKzWJZ+iQSWMoNuDbOk4qiVG tBo3Wbv6tlE3zKsDgrAE= X-Received: by 2002:a05:6000:1686:b0:20a:96e0:9bbe with SMTP id y6-20020a056000168600b0020a96e09bbemr13086395wrd.635.1650874926175; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874996697100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874983; cv=none; d=zohomail.com; s=zohoarc; b=eIGSiqkmjmwQ2lRhug+qKDXKjvK3rGepLIX6+IwddiqzYLsdHZaVp6sfcXwzik8DWRZgP2p4pTkhvGhXv7G3dn5i93HpIeccTvcOVuchzFRxciClrUFhtNjeM86vmUlzb3MTAsYSLKIzX+yOyJOMhIXNDC+Ksc0cg61iQFsq0t0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874983; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=djWLap2ip9TeVgEs3MLYUVyamfKL3oD+pQvj2lMaBx8=; b=AJFylhWpfhPLfR+47KDtpegH9sC00ELhnV9SOvI9fGR++F+Su0mUwih3laXEwtdfnmfUmwELDcQ+DE6Ex2zagcdf7/Dok+ry+0As60a6RI9oDN80Xr3t6tw0MDbW/LEYjKfM/FGrS2yWP9oTfl7lTqg6Q1KsS3EmFyr8o/2/mNQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874983423295.9893258917407; Mon, 25 Apr 2022 01:23:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-VzF-yhWTNq24xxuCaweFXA-1; Mon, 25 Apr 2022 04:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F5A018E5355; Mon, 25 Apr 2022 08:22:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 588AE42B94E; Mon, 25 Apr 2022 08:22:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D1667193F50F; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2D77F194036A for ; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F380240D0188; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF92940D017A for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D307E85A5A8 for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) 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-230-Dek1XV5wM1u6Pn4vYhaNqg-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wm1-f69.google.com with SMTP id n186-20020a1c27c3000000b00392ae974ca1so3865725wmn.0 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=1650874982; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=djWLap2ip9TeVgEs3MLYUVyamfKL3oD+pQvj2lMaBx8=; b=WQNQe+D4kaukFzsTYPbR/3WmTm1s1TbWGQu+ScfbtDWMqstK3Xk/MzrjwmQmBu8fxm/2Af EDacK37FK0C8K00pO1OGZGIWeCMA0HdtFMhrFtA00eykcSVXQOMsozG8QEfOpicZTlVHiR A2dla3Z8cjo9rV8Y1jEEMsE8Cf+BY7E= X-MC-Unique: VzF-yhWTNq24xxuCaweFXA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Dek1XV5wM1u6Pn4vYhaNqg-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=HIu4lI0pKeIl9zQL6gaeQggiMzyM4tWSJ9dNOBO0ZounjR6VPPZ4vGuGxR0VkddlgU qLJeMExpNXQrrPO0bSu8TieTFEDJqBsSYUS6aFYwvH4mabLbQj37rLMIIOfyG8sGzgwi +IJ2Hc1ZF+eZazX2HB0dRhNm5mb2nI160RJFgIHC5n09WHxygqgq2vcSDhiTbhWnZhUn 6IGeShv7a8E9HjsJ9nxamA1dUIIWU1xmcPjlwyft9GSMDT2NUJjrgqbxz+2600cP/rkn iLA4KGUXuxxVzEaF4f1ip+UAMqMeeeWauBClzzq3C06V5kLcDDURtI9LASo23qD1aa2n fERQ== X-Gm-Message-State: AOAM533cUIp3/gCp1d3zVZB9pvZOo7eUe3tS92WjMr8kDzqyqzMv9HZ3 Ju+Nn5P/YuTtO+BMWC3jTRxlrtM6kwswVvZso0cK3dlRTuDf4B+nzwDII6tpcI0zssJ1t8UIZDJ AUq+8CnZmVMUlpixMGA0= X-Received: by 2002:a05:600c:3548:b0:393:ecaa:d7ae with SMTP id i8-20020a05600c354800b00393ecaad7aemr2568971wmq.86.1650874926019; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874985048100003 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874991; cv=none; d=zohomail.com; s=zohoarc; b=jOttLRRRDMCn2bqlIWvLFxb3hg0TYAMRXGqQMrc7s8qqK8TjVefDRj0OktpDNBD7LFi5P8dx1p4fdQeAGIJnUXRBOyTMNrXjYZC3D7VTsbdnpILHk66koruO3cf6oHCF85r5blq2kXAVKbpzcd7Mfn5rHsB2kJp5TC9Jc19ChgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uSjZ4QBWRDNWG4JCXGIx/l5GdZP0dmWgbGQwE/eNVLc=; b=aGlXzP48PDBT8KOBPkTmjlRnxEpRjUPvdVaHyOBEvA4hxXF6EsRymHb6Z/Ar8X2C/vx3p2gtoI0gVym6WYYTIOR4nLUvDV43rFib22HVeCi5hTvBcWAO3nSabEHyDkvrDGVfeDvgyNWHmCChK/gIl3kfLIAIUD4QXmtB5gq7H8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874991207449.7503902358653; Mon, 25 Apr 2022 01:23:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-QnAT0kFmOnmJAUTcAjkk8A-1; Mon, 25 Apr 2022 04:22:25 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7C3F281182A; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D43EB42B939; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7978A193F6E3; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 117D8193F6EB for ; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 015F62167D67; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F12B72167D63 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4EE280418C for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) 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-59-JYNe41-IMMic5WtfuJwlCg-1; Mon, 25 Apr 2022 04:22:08 -0400 Received: by mail-wr1-f69.google.com with SMTP id d28-20020adf9b9c000000b0020ad4a50e14so717473wrc.3 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 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=1650874990; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uSjZ4QBWRDNWG4JCXGIx/l5GdZP0dmWgbGQwE/eNVLc=; b=Que2AKObKvUpyTTXwbCCJLdZCKeKiBBnsyKwQyKJRXOd2d2mdcnMCJuTygwFPKGoX5DTrO DnVGgJMVnkg1rrpKaTKDtyZpn240+uEUGVDheG/YtXiqt2d1vsBfsIrzaMPRJ/lZXo5lmK IJTUQHJF2LQ+T6z++GV8gv3iw7MRozE= X-MC-Unique: QnAT0kFmOnmJAUTcAjkk8A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: JYNe41-IMMic5WtfuJwlCg-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=tzMOdsr/HCkWkOcdonop27wNSSafHQ3Y1w5rd2W83ORrNvYLFmG/dQrHtJL/gE2lGy wn0hLHUXuT7dGQsX8Dx7XLz/iXhjmHg+0iIzyAh9VY8m3mLHhXPxCKHBSSyQVMra+3kn oibcZ4d6i1FK7mgSAKYI4IxadG1g6mu1+zfWhRe16YOqtCfX8128XWt8K0uZj4LzTkQe gEndqa6Q1hf0QDEBjco5RN8uXivW99OBiQky3YZX02/9JS6vgtKbEzGZrIG9JlLMuq67 bZdhh1q0wuPl+WzYJ3+Nu/8vdJ/yYKIZugp+QR9VGCdVigdivUx52CHUg0Asa6WkGOTp RtJA== X-Gm-Message-State: AOAM532MNzx2tgTKYQJZ8pUfrY8FY8H2c25LCMK2nFCW0e/v1AKWmbUZ 0jqvLyOIGQEo5cTZ1YjQfNwmvzzLI5IPJetSLhgZegkRJGcQ6txrNqmeq11oKwQyqCj/Yfp4xXS 6xq50Eia3vtknx18EUPg= X-Received: by 2002:a5d:414b:0:b0:20a:dc15:bd00 with SMTP id c11-20020a5d414b000000b0020adc15bd00mr2725001wrq.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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874992555100016 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874951; cv=none; d=zohomail.com; s=zohoarc; b=JR7a4KEWGx3XhQsDOuEZqAbpGAWql6QVxT3EvmmIRXSMn/F0lYGz7iVTBnmW/cCNhb+fj/d4MZgDAfVqhklkYMIHzJbmtM7KRTvdcvYooSWUUGipmGa81sISqtn57Ykg+YAmQ93Ufh2yg63ELfeG5khnfTu7TKc9XYj6LuolT58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FhQkwseUjLTHOIhK75umw1DiZK4WT0Kj4VwxUvLlvB0=; b=Y1+Tfth8+K7c7kSIvxS0m5UiqQaEgKTT7tRc6/VVZOKvn+r5HpLo/TjBPMmigaCM992TGdzEVNOX8UVe24DMaUPaxY8ZZlWfc5uJooPbs80IryZtQ2dMiTrThqUlIh6cvzpG/Ixlk7Po7s2IVSD6UzHopnqk888H579wBhF/vss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874951705366.0636124021943; Mon, 25 Apr 2022 01:22:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-54-ZCzrO6ZCM7CPJj1rxCfM_Q-1; Mon, 25 Apr 2022 04:22:24 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 87E751014A99; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 712D5416148; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 45F29193F6EE; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6EB131947BBE for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4F8BE1468F22; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B55B1468F35 for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 295D2803D65 for ; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) 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-404-5k2DCatlOZCNww2qXRpYsg-1; Mon, 25 Apr 2022 04:22:07 -0400 Received: by mail-wm1-f69.google.com with SMTP id k66-20020a1ca145000000b003928959f8efso5510011wme.1 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=1650874950; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FhQkwseUjLTHOIhK75umw1DiZK4WT0Kj4VwxUvLlvB0=; b=LVmC2cYlK8vVN6DK6qPWjoXm0Mwzuzru3i/8zcumCROVIJl9FHV6t1wDsJ5LC34FlZpTBu D2jPJCQL6inR/2LzN02zIqYNc0l5lzBHMgjBPnfUQ0wk5wQd1mt0hevYJ8A7EJPxOfzFi3 syqFdCNILnwlgbsgcxRhUHRBveFfP3s= X-MC-Unique: ZCzrO6ZCM7CPJj1rxCfM_Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 5k2DCatlOZCNww2qXRpYsg-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=jhM9izCsuErwEkeJZA2jT04N/h7G1pSUTB/sc5kti28TP011f/rk6DztoNW2uVO1ur lysus8KW3AHkxMXOv27tGFBlnvitlzk/8FBKfDjTx8vsB0NJv5n6c0pF9QypQ71PymXV 77cC2UMzur4W8pGoOUVHlmX/Yliw75kS5M4PVn4Kv0JJdN4b6mI0WDnSF2DAC2Sk37nY k0FxckXhuJscXUF6psTWkTWRl0KJy/cl6KHUCM9RewshMWEqvHLmHGMhoZcS6PN9oFUm Nuic4WlrB0o5BIpTVZn34oRIz8LeaDgU9yj929Axtypnh0QNhMDf1r/02iXFvaWp0KsT FZqQ== X-Gm-Message-State: AOAM533TDj85w7N/RL6c3NY41Tdh3ixWFMRX+WJgvoG0bRvlJeygq+o2 wRlyY8cfqCoy0H4QmjxTQqnZy5dwul4yZKEM7llDe04lWwbYB1uacfZhSO2sHr9OQ3Qm9kN0w1K QVU49q8RBUgY6SuDKivk= X-Received: by 2002:a05:600c:21d1:b0:381:4fed:159a with SMTP id x17-20020a05600c21d100b003814fed159amr15601985wmj.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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874973688100012 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874948; cv=none; d=zohomail.com; s=zohoarc; b=hDLGLKWfVg2vu4PrYDc+uh6e9GAQms6EpUVerFZMFmJlx65ln+9iLiLR/uaqfgqDOr5Hgvi82KV6liXxXNZVsIRAFYimYzjeME9lvlmIdlwcfE9G7t5/Bygx11dfh57XICvPM5oPiJZHqDMFWwbz0vuNHdxlrA8RXgRrHj02dkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874948; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RNMCFsdt1DfVphZXSznWDAJKRd268N5F4URsC76WAsg=; b=M8t+W2Lv4wQgmh36dAvpAq9Kei/N3SV37A6qaJ0TI5fB8E96Fru1Ko3dT1lnVaOHBHUJWI+6dub7gxKLPqP7b9lMX0bJ8jZfVXb12cJECZ9/TB1pGh/EwbcZbmEkExhqwDCUaxnWJesEvRI4VmaHLe2VNGj3QJQXSiq5FEY+Zrg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874948786329.537284530369; Mon, 25 Apr 2022 01:22:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-ovQ7XKPCN4e92Cu0mMwCvg-1; Mon, 25 Apr 2022 04:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0A60418E528A; Mon, 25 Apr 2022 08:22:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE7E21468F3D; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D0B84193F6E1; Mon, 25 Apr 2022 08:22:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EA79C1940356 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1142340E80F4; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0ABD140E80E5 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3F4E1C05EB2 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) 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-444-WoyqyOG7OXuWYwzymZsyvQ-1; Mon, 25 Apr 2022 04:22:08 -0400 Received: by mail-wm1-f71.google.com with SMTP id i66-20020a1c3b45000000b0038eab4e0feaso6451963wma.9 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=1650874947; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RNMCFsdt1DfVphZXSznWDAJKRd268N5F4URsC76WAsg=; b=UnRdOhapsvZhVLJJid1i/MW1mNc9uyhSQk7VaRz2r9RQ7ROXM+XI2Y+uvBiB4BO576kGsM cj+KojaJjnH9d6UFmZGOl7Jhsg/ShYqe/uHrU3wvtINFTBiw8sLOqccq5DTl++tVuxoAng IyuMg7bDXvuqc//gwJm6jfzd8/AwOYI= X-MC-Unique: ovQ7XKPCN4e92Cu0mMwCvg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: WoyqyOG7OXuWYwzymZsyvQ-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=wiS19BkOQf3krucJoebETwVMTtMwA7NiMlk6wgjRylNB8gbZyDMOyVuofEw7EDCd1s He7+h54InyKJOUoimzt5onuSBwVqUyHIELDKrlX63wlZMsErJknErnbx9vdyHgDQlasg /Jwvh0e7HDp3mTIu/wbTy3qeFH0RJUHncNlDEr44jj4quSiyk9AsWDqTplsQXoOZLEdZ LXSb4lYclEyyCksS0hmqnsC0ImhcoAMv9o7kHLD8pNhNxYzsV6pLLZUsYj7fxVdiQ3YS D6SHI/wY8HKeyugATcUjGLmTginmA7ljQHWWUCQgLxDAiu+lsNxaZrCKPq+wrI8elV2x NmUQ== X-Gm-Message-State: AOAM533r/3AavE9lGP5yBvv8pbYp55CmRPR2kw+WHFF4wM6R/qy7VHxJ 53RWfP5oUbBMRll/btS7Ok8cwPRYwWbMz/I89azidCdBXs2Kj5C8rHVFHwneoHjSbje4zy1tChx L4bI8kSfWChu6BmYXGoQ= X-Received: by 2002:a5d:4fca:0:b0:20a:cf56:a894 with SMTP id h10-20020a5d4fca000000b0020acf56a894mr9298196wrw.528.1650874926952; 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: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874973625100011 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874987; cv=none; d=zohomail.com; s=zohoarc; b=Ep83Oz78f0h9fW34CC5QSVxUnOTVaVZM8koSgO1RDj/6ETbqgZwA5bCKpuBi2dAxoqIA7KJ6d5I729agZRq9ILcXN41k+38uFEalcMbo/dAoXxcmhKw5DXXxtkKDt9HqEh/8xw3Ha7iWzNqVaG2q1WmdDNMBQSulN4iheTb9yZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874987; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hI7bzsmky1WaiM9g+64rTyViI5OA6WYELvRET0z3sHg=; b=MeYkzM3OINEUmIbSnk6FKZxBuQev3NyIPT7DFTv7yawk3EK04sjj502oPQvoQh+rL/Ma8JruH/BxU3ZXSGm6mD2YrjQ5lhWhQMZ9/Z3/4yPXoFaB0qUcuWr4Dy2Usmr/dknPp3m7pL+Te5DYJXDCsAeneMSVC6jdD6IHGWFjRRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874987202698.297765373913; Mon, 25 Apr 2022 01:23:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-qr8ugECyPJSCEXSP0uIQIA-1; Mon, 25 Apr 2022 04:22:30 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9DB5185A794; Mon, 25 Apr 2022 08:22:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4BAD42B93B; Mon, 25 Apr 2022 08:22:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7DFCC1940361; Mon, 25 Apr 2022 08:22:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 73BF31947BBD for ; Mon, 25 Apr 2022 08:22:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 56C47111E411; Mon, 25 Apr 2022 08:22:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5286A1121315 for ; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DA80833963 for ; Mon, 25 Apr 2022 08:22:14 +0000 (UTC) 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-651-LrE_4QFsMtGYq_z62tfSMA-1; Mon, 25 Apr 2022 04:22:10 -0400 Received: by mail-wm1-f71.google.com with SMTP id q188-20020a1c43c5000000b003928f679c42so6461668wma.5 for ; Mon, 25 Apr 2022 01:22:10 -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=1650874986; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hI7bzsmky1WaiM9g+64rTyViI5OA6WYELvRET0z3sHg=; b=aWIEppqupW4hI/Ha9yZQTqlOPbWR5cKdV8YbKKBz4ROILUYIPMVJhlQ2goWz6fcP0MKlyt yPmlxl85ODMS7Z78y1/xMlUreLyCya4RQNqDDbxsosqOY4fJfX2gw4mMCp/I04Ap2dultX 4I05ZAuQyOkbUhthngkKrNgUOt9mOpg= X-MC-Unique: qr8ugECyPJSCEXSP0uIQIA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: LrE_4QFsMtGYq_z62tfSMA-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=rioaQDNGcJ7dETXY0mly8OFPJpO3/kHRW2scjhRtQRleBFxs/hwuHrzzDAFfSJCMKb I39RahCCiUG/ITkT0mhKs1rudBWYn+UcrptvBK60QEb29X5cXZOGsCgQB4eotuaQ+Lnq 6EZvk1NITqENoqd/yFtiyp2T7eSKdbBlpqh4i9S0PILPQU0OSKPaQ6WXK+asioXqKqkn ksBOHFLRzeRBVO2x/XBWqvjgxIl2qBygdh3MzkSmCvwuyRftlryc9GgW+Ob0WpGck9If nK12Pe5Bec/8i5O4eAdUIVnOBt4nHqg5fNAAjtryk48P3JaAVEw2/b/FGaTYLCazFMVK 6qAA== X-Gm-Message-State: AOAM533b4TwVhsNeT5EsBmR5hd2zOIqFL2OgqVPd8+jTawYWT/MVqKzz 3tsi16b3G8m0FxbSYWvtA9utypigroDz5z43rAOvU6j3B33O/Vi7QkNYzMQV+O0lSW+Iyuljk9F 4Trz5oZ85PYASneJ0Z1U= X-Received: by 2002:a05:6000:1e0a:b0:20a:be21:a20 with SMTP id bj10-20020a0560001e0a00b0020abe210a20mr13321991wrb.214.1650874926590; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874988541100010 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Mon May 13 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874985; cv=none; d=zohomail.com; s=zohoarc; b=Xp2DYGmbj++VwRUBTIwjIvqn5384znIBRat9QZTNeuavNgMnTAfVJKjgFHp58J923pvrs7U7Ae4A2BkTRNJFy8dq3TOIQREfl+GrScLnlviLyUrLvE7WeSSuQnIwBOBPIM6LvZCTXKixTI+NuitEUc1KPSksnM1oKmPUen48/c8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874985; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s9HfXFFqm8XD3sd/B71lxNFxNbf5q88arJTDKzK7o3M=; b=j2QwqyE6YmtMqf5IN89ym7jOX/U75Sif6c/25J0Hf+46feGz848F287ZY24M7Qhl8rhcbsD2Yv64KeKHjWOOFVM6NPp2h5evAEDY2VxRJH90u7HpbxFqcNqtX0DeN74JK/U+f15KhCjfGDWdXiqdUe5lCxfZCQtDfzj1s7U/Tuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 165087498562628.19531215991617; Mon, 25 Apr 2022 01:23:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-XwX8N38SNcqEmZug3lqFZA-1; Mon, 25 Apr 2022 04:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22393805F63; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 047CF1468970; Mon, 25 Apr 2022 08:22:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F29F4193F6E4; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DBF631947BBE for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB4C840E80F7; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6DBD40E80E5 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF970299E752 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) 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-448-7tH8xOmaNFGwjCq8sxn45Q-1; Mon, 25 Apr 2022 04:22:08 -0400 Received: by mail-wm1-f72.google.com with SMTP id p21-20020a1c5455000000b0038ff4f1014fso6449817wmi.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=1650874984; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=s9HfXFFqm8XD3sd/B71lxNFxNbf5q88arJTDKzK7o3M=; b=Tefdg8/btHbgAtBugxvZ8KQsu9bXfQJBvv6ZvOf2sVvLtV6Cq567UCyFzMet0OWnXxP2Ak er/53DcD+iDZRFTK23Sgkq7W4wdg9GKh633RyIzXCsFv6ofqb2nQuRLfU9yZ4qrrQVbhql Rh3xJpaeAyEPNg7MWJpMC7z8EtRnKXs= X-MC-Unique: XwX8N38SNcqEmZug3lqFZA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 7tH8xOmaNFGwjCq8sxn45Q-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=yH38OfkDeRcAQbTDpGzwNoP/e7JuPm7/nZFPq9wFqLkw5yrWG1qWNpHj172FDrmqJE KbeupULBNAPr5M7sM3vocnBSjb9UZrx6rw9KTunfhVGePdtRb5GBbfo+WKTX7FtiGVWu o561x/Hd2MfDxQGCbx4qkPmKbg0dy5rpdatMAha6KwRn1l2VOVJ8TUUBnpzog7I0HdVn lesQfyGchI2SQiBS5CyaUXNYUOuf/AfJoWp2XtV2M/9p2QFkuy4WXgAtKNzlmraSzOVN 1aIWWzFRtIUFG2ws8bSCSfPWppHVWLEgcTF+CRkvW/vp05Kdzaz+g3/A7APFUs26uNAu hd9A== X-Gm-Message-State: AOAM530PGr0AUj6uhx964RDA2RSUcbWRXvQqoe0tnnVrhASCsBQObiqR Qh0ECGm013wHdnG0etYuvSVAqQ4VM+KAqTTLPVmj8IxXeoBL3ToJN+V5Q9yrbRS19G2PubYFU54 rKIbmZLFtU0r5bUKZXSE= X-Received: by 2002:a05:600c:500c:b0:392:b12f:40a with SMTP id n12-20020a05600c500c00b00392b12f040amr15318852wmr.122.1650874926859; 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> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools 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?= , Marcel Apfelbaum , =?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 , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874986582100007 Content-Type: text/plain; charset="utf-8"; x-default="true" 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