[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/15] hw/audio/virtio-snd-pci: fix the PCI class code
From: |
Michael S. Tsirkin |
Subject: |
[PULL 04/15] hw/audio/virtio-snd-pci: fix the PCI class code |
Date: |
Fri, 1 Dec 2023 12:15:18 -0500 |
From: Volker Rümelin <vr_qemu@t-online.de>
The virtio sound device is currently an unclassified PCI device.
~> sudo lspci -s '00:02.0' -v -nn | head -n 2
00:02.0 Unclassified device [00ff]:
Red Hat, Inc. Device [1af4:1059] (rev 01)
Subsystem: Red Hat, Inc. Device [1af4:1100]
Set the correct PCI class code to change the device to a
multimedia audio controller.
~> sudo lspci -s '00:02.0' -v -nn | head -n 2
00:02.0 Multimedia audio controller [0401]:
Red Hat, Inc. Device [1af4:1059] (rev 01)
Subsystem: Red Hat, Inc. Device [1af4:1100]
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20231107185034.6434-1-vr_qemu@t-online.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/audio/virtio-snd-pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c
index 0f92e0752b..ab58c6410e 100644
--- a/hw/audio/virtio-snd-pci.c
+++ b/hw/audio/virtio-snd-pci.c
@@ -47,12 +47,14 @@ static void virtio_snd_pci_class_init(ObjectClass *klass,
void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass);
+ PCIDeviceClass *pcidevklass = PCI_DEVICE_CLASS(klass);
device_class_set_props(dc, virtio_snd_pci_properties);
dc->desc = "Virtio Sound";
set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
vpciklass->realize = virtio_snd_pci_realize;
+ pcidevklass->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;
}
static void virtio_snd_pci_instance_init(Object *obj)
--
MST
- [PULL 00/15] virtio,pc,pci: fixes, Michael S. Tsirkin, 2023/12/01
- [PULL 04/15] hw/audio/virtio-snd-pci: fix the PCI class code,
Michael S. Tsirkin <=
- [PULL 05/15] hw/audio/hda-codec: fix multiplication overflow, Michael S. Tsirkin, 2023/12/01
- [PULL 01/15] osdep: add getloadavg, Michael S. Tsirkin, 2023/12/01
- [PULL 07/15] virtio-snd: check AUD_register_card return value, Michael S. Tsirkin, 2023/12/01
- [PULL 15/15] vhost-user-scsi: free the inflight area when reset, Michael S. Tsirkin, 2023/12/01
- [PULL 02/15] netdev: set timeout depending on loadavg, Michael S. Tsirkin, 2023/12/01
- [PULL 03/15] tests/acpi/bios-tables-test: do not write new blobs unless there are changes, Michael S. Tsirkin, 2023/12/01
- [PULL 09/15] pcie_sriov: Remove g_new assertion, Michael S. Tsirkin, 2023/12/01
- [PULL 10/15] hw/acpi/erst: Do not ignore Error* in realize handler, Michael S. Tsirkin, 2023/12/01