hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sat, 25 Jan 2025 17:36:50 +0000 (18:36 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 16 Feb 2025 13:25:07 +0000 (14:25 +0100)
Do not explain why _X86_IOMMU devices are user_creatable,
have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit
they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alexander Graf <graf@amazon.com>
Reviewed-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
Message-Id: <20250125181343.59151-7-philmd@linaro.org>

hw/i386/amd_iommu.c
hw/i386/intel_iommu.c
hw/i386/x86-iommu.c

index 6b13ce894b1aa70e107d932815dcc099c3d32db4..e8e084c7cf8759d8e593a969adae9823cde8065f 100644 (file)
@@ -1687,8 +1687,6 @@ static void amdvi_sysbus_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = false;
     dc_class->realize = amdvi_sysbus_realize;
     dc_class->int_remap = amdvi_int_remap;
-    /* Supported by the pc-q35-* machine types */
-    dc->user_creatable = true;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device";
     device_class_set_props(dc, amdvi_properties);
index f366c223d0e1bc5c0c9fcc7b6ed90bbe1ced5471..7fde0603bfefa13f0818aac7cd6991b637653c80 100644 (file)
@@ -4871,8 +4871,6 @@ static void vtd_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = false;
     x86_class->realize = vtd_realize;
     x86_class->int_remap = vtd_int_remap;
-    /* Supported by the pc-q35-* machine types */
-    dc->user_creatable = true;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->desc = "Intel IOMMU (VT-d) DMA Remapping device";
 }
index fed34b2fcfa7d9b92ff8f4271f8d462dee545473..5cdd165af0db8ac5c8b158ab4f3594ba2bbd92c1 100644 (file)
@@ -146,7 +146,7 @@ bool x86_iommu_ir_supported(X86IOMMUState *s)
 
 static const TypeInfo x86_iommu_info = {
     .name          = TYPE_X86_IOMMU_DEVICE,
-    .parent        = TYPE_SYS_BUS_DEVICE,
+    .parent        = TYPE_DYNAMIC_SYS_BUS_DEVICE,
     .instance_size = sizeof(X86IOMMUState),
     .class_init    = x86_iommu_class_init,
     .class_size    = sizeof(X86IOMMUClass),