]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/i386/amd_iommu: Add description/category to TYPE_AMD_IOMMU_PCI
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 26 Sep 2021 17:56:48 +0000 (19:56 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 5 Oct 2021 21:30:57 +0000 (17:30 -0400)
TYPE_AMD_IOMMU_PCI is user-creatable but not well described.
Implement its class_init() handler to add it to the 'Misc
devices' category, and add a description.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210926175648.1649075-4-f4bug@amsat.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/amd_iommu.c

index 9014690ba3a5a6d28a8fe0b03e194dabf06ade26..9242a0d3ed8de85e950f80498ec175c23ea51667 100644 (file)
@@ -1621,10 +1621,19 @@ static const TypeInfo amdvi_sysbus = {
     .class_init = amdvi_sysbus_class_init
 };
 
+static void amdvi_pci_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device";
+}
+
 static const TypeInfo amdvi_pci = {
     .name = TYPE_AMD_IOMMU_PCI,
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(AMDVIPCIState),
+    .class_init = amdvi_pci_class_init,
     .interfaces = (InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },