pcie: Convert PCIExpressHost to use the QOM.

Let's use PCIExpressHost with QOM.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Jason Baron 2012-10-19 16:43:33 -04:00 committed by Michael S. Tsirkin
parent c702ddb8da
commit bc927e488c
2 changed files with 18 additions and 0 deletions

View File

@ -145,3 +145,17 @@ void pcie_host_mmcfg_update(PCIExpressHost *e,
pcie_host_mmcfg_map(e, addr, size); pcie_host_mmcfg_map(e, addr, size);
} }
} }
static const TypeInfo pcie_host_type_info = {
.name = TYPE_PCIE_HOST_BRIDGE,
.parent = TYPE_PCI_HOST_BRIDGE,
.abstract = true,
.instance_size = sizeof(PCIExpressHost),
};
static void pcie_host_register_types(void)
{
type_register_static(&pcie_host_type_info);
}
type_init(pcie_host_register_types)

View File

@ -24,6 +24,10 @@
#include "pci_host.h" #include "pci_host.h"
#include "memory.h" #include "memory.h"
#define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge"
#define PCIE_HOST_BRIDGE(obj) \
OBJECT_CHECK(PCIExpressHost, (obj), TYPE_PCIE_HOST_BRIDGE)
struct PCIExpressHost { struct PCIExpressHost {
PCIHostState pci; PCIHostState pci;