aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-28 18:12:47 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:37 +0200
commitbce544740a87cac1636f01c8a28502fec1694b3d (patch)
tree9967a3c299edcb4c32febe4019d7a98c5b205df2 /hw/pci.c
parent3cb75a7cba7e808c0ae007e4d86750849642304e (diff)
downloadqemu-bce544740a87cac1636f01c8a28502fec1694b3d.zip
qemu-bce544740a87cac1636f01c8a28502fec1694b3d.tar.gz
qemu-bce544740a87cac1636f01c8a28502fec1694b3d.tar.bz2
qdev: Move bus properties to abstract superclasses
In qdev, each bus in practice identified an abstract superclass, but this was mostly hidden. In QOM, instead, these abstract classes are explicit so we can move bus properties there. All bus property walks are removed, and all device property walks are changed to look along the class hierarchy instead. We would have duplicates if class A defines some properties and its subclass B does not define any, because class_b->props will be left equal to class_a->props. The solution here is to reintroduce the class_base_init TypeInfo callback, that was present in one of the early QOM versions but removed (on my request...) before committing. This breaks global bus properties, an obscure feature when used with the command-line which is actually useful and used when used by backwards-compatible machine types. So this patch also adjusts the global bus properties in hw/pc_piix.c to refer to the abstract class. Globals and other properties must be modified in the same patch to avoid complications related to initialization ordering. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 377039e..09ce4e7 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -62,7 +62,6 @@ struct BusInfo pci_bus_info = {
.get_dev_path = pcibus_get_dev_path,
.get_fw_dev_path = pcibus_get_fw_dev_path,
.reset = pcibus_reset,
- .props = pci_props,
};
static PCIBus *pci_find_bus_nr(PCIBus *bus, int bus_num);
@@ -2003,6 +2002,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
k->unplug = pci_unplug_device;
k->exit = pci_unregister_device;
k->bus_info = &pci_bus_info;
+ k->props = pci_props;
}
static TypeInfo pci_device_type_info = {