From nobody Tue Dec 16 07:26:08 2025 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