From: Marc-André Lureau Date: Wed, 8 Oct 2025 12:13:38 +0000 (+0400) Subject: hw/audio/virtio-snd-pci: remove custom model callback X-Git-Tag: v10.2.0-rc1~29^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=341eaea215a963016f814bdd11c45c68c9bf1e32;p=thirdparty%2Fqemu.git hw/audio/virtio-snd-pci: remove custom model callback virtio-snd can rely on the default code to instantiate the device and set the audiodev. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c index 613538e46f..b78eaff851 100644 --- a/hw/audio/virtio-snd-pci.c +++ b/hw/audio/virtio-snd-pci.c @@ -71,24 +71,10 @@ static const VirtioPCIDeviceTypeInfo virtio_snd_pci_info = { .class_init = virtio_snd_pci_class_init, }; -/* Create a Virtio Sound PCI device, so '-audio driver,model=virtio' works. */ -static int virtio_snd_pci_init(PCIBus *bus, const char *audiodev) -{ - DeviceState *vdev = NULL; - VirtIOSoundPCI *dev = NULL; - - vdev = qdev_new(TYPE_VIRTIO_SND_PCI); - assert(vdev); - dev = VIRTIO_SND_PCI(vdev); - qdev_prop_set_string(DEVICE(&dev->vdev), "audiodev", audiodev); - qdev_realize_and_unref(vdev, BUS(bus), &error_fatal); - return 0; -} - static void virtio_snd_pci_register(void) { virtio_pci_types_register(&virtio_snd_pci_info); - audio_register_model_with_cb("virtio", "Virtio Sound", virtio_snd_pci_init); + audio_register_model("virtio", "Virtio Sound", 0, TYPE_VIRTIO_SND_PCI); } type_init(virtio_snd_pci_register);