mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 01:43:39 +00:00
i440fx: Register i440FX-pcihost properties as class properties
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200921221045.699690-23-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
acd5b054e4
commit
53f6474626
|
@ -210,22 +210,6 @@ static void i440fx_pcihost_initfn(Object *obj)
|
|||
"pci-conf-idx", 4);
|
||||
memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s,
|
||||
"pci-conf-data", 4);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32",
|
||||
i440fx_pcihost_get_pci_hole_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32",
|
||||
i440fx_pcihost_get_pci_hole_end,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64",
|
||||
i440fx_pcihost_get_pci_hole64_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64",
|
||||
i440fx_pcihost_get_pci_hole64_end,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
|
||||
|
@ -401,6 +385,22 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data)
|
|||
device_class_set_props(dc, i440fx_props);
|
||||
/* Reason: needs to be wired up by pc_init1 */
|
||||
dc->user_creatable = false;
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32",
|
||||
i440fx_pcihost_get_pci_hole_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32",
|
||||
i440fx_pcihost_get_pci_hole_end,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint64",
|
||||
i440fx_pcihost_get_pci_hole64_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64",
|
||||
i440fx_pcihost_get_pci_hole64_end,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static const TypeInfo i440fx_pcihost_info = {
|
||||
|
|
Loading…
Reference in a new issue