diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 2e629b398b0cfa61986f14b2fc52432596b4013c..5c28a0b0adefaaba8bc6d4d8bde23471458c7ab5 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2880,6 +2880,11 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) dc->props = sysbus_fdc_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo sysbus_fdc_info = { @@ -2906,6 +2911,11 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) dc->props = sun4m_fdc_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo sun4m_fdc_info = { diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 594d4cf6fed0f0842216e15662803b17d4e8496e..ef7195643307422b929096c4abda6a94461ff272 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -927,6 +927,11 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) dc->props = pflash_cfi01_properties; dc->vmsd = &vmstate_pflash; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index c0f560b289c410e0a0a1d7fde7cd810174f6231f..5d0887f499deb59b69798e756b5c4d149ddf7ee8 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -326,6 +326,17 @@ static void sysbus_device_class_init(ObjectClass *klass, void *data) DeviceClass *k = DEVICE_CLASS(klass); k->init = sysbus_device_init; k->bus_type = TYPE_SYSTEM_BUS; + /* + * device_add plugs devices into a suitable bus. For "real" buses, + * that actually connects the device. For sysbus, the connections + * need to be made separately, and device_add can't do that. The + * device would be left unconnected, and will probably not work + * + * However, a few machines can handle device_add/-device with + * a few specific sysbus devices. In those cases, the device + * subclass needs to override it and set user_creatable=true. + */ + k->user_creatable = false; } static const TypeInfo sysbus_device_type_info = { diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index f86a40aa305c3f10d904136ad736dd967a6f9a4e..7b92c8c15a51a7198f2532894ba451a809f5612f 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1186,6 +1186,11 @@ static void amdvi_class_init(ObjectClass *klass, void* data) dc->vmsd = &vmstate_amdvi; dc->hotpluggable = false; dc_class->realize = amdvi_realize; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo amdvi = { diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 02f047c8e3a616dd7717ef78dcee91290dd74582..54187a04a4fde2e8c948e7f63c6154410713b02f 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3009,6 +3009,11 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo vtd_info = { diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 13eca374cded13d4226bc4380a8d37769e9913ae..7665bef999fc2fd3f79951290424852ef16b7838 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -286,6 +286,11 @@ static void kvmclock_class_init(ObjectClass *klass, void *data) dc->realize = kvmclock_realize; dc->vmsd = &kvmclock_vmsd; dc->props = kvmclock_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo kvmclock_info = { diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index 98ca480792523584e9cbd02fea8bb57536af67d4..348c40518030c76e13932255be46879a516fc15d 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -167,6 +167,11 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data) k->post_load = kvm_ioapic_put; dc->reset = kvm_ioapic_reset; dc->props = kvm_ioapic_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo kvm_ioapic_info = { diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 82a49556af7221cc81b4277b75e16445aef00f19..45f6267c93ed7190c667922c506ccb6fead38765 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -856,6 +856,11 @@ static void vapic_class_init(ObjectClass *klass, void *data) dc->reset = vapic_reset; dc->vmsd = &vmstate_vapic; dc->realize = vapic_realize; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo vapic_type = { diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index f60826d6e0d4742d71adda1d13d2a8379f642cf1..7f10cda354c57dbd038dd75c367e1d13619de6ba 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1721,6 +1721,11 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) dc->props = sysbus_ahci_properties; dc->reset = sysbus_ahci_reset; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo sysbus_ahci_info = { @@ -1815,6 +1820,11 @@ static void allwinner_ahci_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_allwinner_ahci; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo allwinner_ahci_info = { diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 37c4386ae3a446fb08758211af9f6660b846e536..f9e4f77def8de71052d01986a20666365e9ef27c 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -448,6 +448,11 @@ static void ioapic_class_init(ObjectClass *klass, void *data) k->post_load = ioapic_update_kvm_routes; dc->reset = ioapic_reset_common; dc->props = ioapic_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo ioapic_info = { diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 348e0eab9d9e8689b6a0806bbce827ecf8d680d0..ad4ac3b4f6f49b90532809122508721825ae8544 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -221,6 +221,11 @@ static void isabus_bridge_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "isa"; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo isabus_bridge_info = { diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index bcbb585888a8bb5454bf49e456ecc33388547cf7..e446c1d65234c100d041f696c87ce6c53d121f3c 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -90,6 +90,11 @@ static void unimp_class_init(ObjectClass *klass, void *data) dc->realize = unimp_realize; dc->props = unimp_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo unimp_info = { diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index aa2b0d5a851a61189d9feaafe072f1d63e06c6c5..9da19329706c9222143f27dfb5bebd5e3000cd19 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -416,6 +416,8 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; dc->reset = etsec_reset; dc->props = etsec_properties; + /* Supported by ppce500 machine */ + dc->user_creatable = true; } static TypeInfo etsec_info = { diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 316fca9bc1dadf8777ad9a9c238381702022bc56..7993aea7922760e7a0e6071c6ae7dd4548dc2b29 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1101,6 +1101,11 @@ static void fw_cfg_io_class_init(ObjectClass *klass, void *data) dc->realize = fw_cfg_io_realize; dc->props = fw_cfg_io_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo fw_cfg_io_info = { @@ -1167,6 +1172,11 @@ static void fw_cfg_mem_class_init(ObjectClass *klass, void *data) dc->realize = fw_cfg_mem_realize; dc->props = fw_cfg_mem_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo fw_cfg_mem_info = { diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index e7567e2e8f71f585b345251c5ce9ba095706e21c..a7cff32bbf3ce52c1950eb5e7d459fc175b7cf5c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1994,6 +1994,8 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) dc->props = spapr_phb_properties; dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci; + /* Supported by TYPE_SPAPR_MACHINE */ + dc->user_creatable = true; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); hp->plug = spapr_phb_hot_plug_child; hp->unplug = spapr_phb_hot_unplug_child; diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index eee831efebc42ef0ef569cccba055e4ed528e04d..7bdc1e1b99f9a1a7ab00494e33280bb9d4283fb8 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -728,6 +728,11 @@ static void sysbus_esp_class_init(ObjectClass *klass, void *data) dc->reset = sysbus_esp_hard_reset; dc->vmsd = &vmstate_sysbus_esp_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo sysbus_esp_info = { diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 6d6a791ee9c07a553fa6a8e1e5cd0749e1b0a6d2..dbf61fccb84c0ed6e0db93a959dad36e75c2e601 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1360,6 +1360,11 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) dc->props = sdhci_sysbus_properties; dc->realize = sdhci_sysbus_realize; dc->reset = sdhci_poweron_reset; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo sdhci_sysbus_info = { diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index a2c18b30c33a7044b1d80b126e55577ae4128934..4dcbd5bb3d32f43da938d8987fdca0396ac523f3 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -771,6 +771,11 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->reset = hpet_reset; dc->vmsd = &vmstate_hpet; dc->props = hpet_device_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo hpet_device_info = { diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 3ada35e954e86262263d449750b7cb6c7e427516..18b31022a71b0ef9be15094865abf8973d998559 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -2159,6 +2159,11 @@ static void ohci_sysbus_class_init(ObjectClass *klass, void *data) dc->desc = "OHCI USB Controller"; dc->props = ohci_sysbus_properties; dc->reset = usb_ohci_reset_sysbus; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo ohci_sysbus_info = { diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c index 2c60310cf960151cb9ff701456bd0fbb1bdeea29..fab196cebff4d1643aa0d87136dd03ce4c8bf8e1 100644 --- a/hw/vfio/amd-xgbe.c +++ b/hw/vfio/amd-xgbe.c @@ -38,6 +38,8 @@ static void vfio_amd_xgbe_class_init(ObjectClass *klass, void *data) dc->realize = amd_xgbe_realize; dc->desc = "VFIO AMD XGBE"; dc->vmsd = &vfio_platform_amd_xgbe_vmstate; + /* Supported by TYPE_VIRT_MACHINE */ + dc->user_creatable = true; } static const TypeInfo vfio_amd_xgbe_dev_info = { diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c index bb15d588e529d2a4d7c4a40e792a911fde4597a3..7bb17af7addc4a425f77943ded4dc67b70fd52f4 100644 --- a/hw/vfio/calxeda-xgmac.c +++ b/hw/vfio/calxeda-xgmac.c @@ -38,6 +38,8 @@ static void vfio_calxeda_xgmac_class_init(ObjectClass *klass, void *data) dc->realize = calxeda_xgmac_realize; dc->desc = "VFIO Calxeda XGMAC"; dc->vmsd = &vfio_platform_calxeda_xgmac_vmstate; + /* Supported by TYPE_VIRT_MACHINE */ + dc->user_creatable = true; } static const TypeInfo vfio_calxeda_xgmac_dev_info = { diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 5807aa87fe8e99e5f589e9553571d88bdb78677b..6491a771ffb6a6b6dec3b7b5134f070100989ad9 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -450,6 +450,11 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) dc->reset = virtio_mmio_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->props = virtio_mmio_properties; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo virtio_mmio_info = { diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 2cac47d6c42a84e01eb58b55bbdab2f3ea2effe4..2df102a716826b4bb11af67b9f4f097657b0bfd3 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -619,6 +619,11 @@ static void xendev_class_init(ObjectClass *klass, void *data) dc->props = xendev_properties; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo xendev_type_info = { @@ -662,6 +667,11 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data) k->init = xen_sysdev_init; dc->props = xen_sysdev_properties; dc->bus_type = TYPE_XENSYSBUS; + /* + * FIXME: Set only because we are not sure yet if this device + * will be outside the q35 sysbus whitelist. + */ + dc->user_creatable = true; } static const TypeInfo xensysdev_info = {