aboutsummaryrefslogtreecommitdiff
path: root/hw/audio/intel-hda.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-27 12:27:46 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-14 12:33:44 +0200
commit039a68373c4544ff94871f945a733928b6dcfe93 (patch)
tree9a4d966054f19e7c967a5d9c046d9ab184ab0fc3 /hw/audio/intel-hda.c
parent67aaa96ae451913ffd25766dc59341fe6b63619d (diff)
introduce -audio as a replacement for -soundhw
-audio is used like "-audio pa,model=sb16". It is almost as simple as -soundhw, but it reuses the -audiodev parsing machinery and attaches an audiodev to the newly-created device. The main 'feature' is that it knows about adding the codec device for model=intel-hda, and adding the audiodev to the codec device. In the future, it could be extended to support default models or builtin devices, just like -nic, or even a default backend. For now, keep it simple. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/audio/intel-hda.c')
-rw-r--r--hw/audio/intel-hda.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index bc77e3d8c9..f38117057b 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -1311,17 +1311,16 @@ static const TypeInfo hda_codec_device_type_info = {
* create intel hda controller with codec attached to it,
* so '-soundhw hda' works.
*/
-static int intel_hda_and_codec_init(PCIBus *bus)
+static int intel_hda_and_codec_init(PCIBus *bus, const char *audiodev)
{
DeviceState *controller;
BusState *hdabus;
DeviceState *codec;
- warn_report("'-soundhw hda' is deprecated, "
- "please use '-device intel-hda -device hda-duplex' instead");
controller = DEVICE(pci_create_simple(bus, -1, "intel-hda"));
hdabus = QLIST_FIRST(&controller->child_bus);
codec = qdev_new("hda-duplex");
+ qdev_prop_set_string(codec, "audiodev", audiodev);
qdev_realize_and_unref(codec, hdabus, &error_fatal);
return 0;
}