pci_bridge_to_pci() which converts PCIBridge into PCIDevice which will be used later by pci_p2pbr.
Cc: Michael S. Tsirkin <m...@redhat.com> Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp> --- hw/pci_bridge.c | 6 ++++++ hw/pci_bridge.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c index 464d897..00b6b76 100644 --- a/hw/pci_bridge.c +++ b/hw/pci_bridge.c @@ -52,6 +52,12 @@ int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset, return pos; } +/* Accessor function to get PCI device from pci bridge. */ +PCIDevice *pci_bridge_to_pci(PCIBridge *br) +{ + return &br->dev; +} + /* Accessor function to get parent bridge device from pci bus. */ PCIDevice *pci_bridge_get_device(PCIBus *bus) { diff --git a/hw/pci_bridge.h b/hw/pci_bridge.h index 84411a6..c306992 100644 --- a/hw/pci_bridge.h +++ b/hw/pci_bridge.h @@ -31,6 +31,7 @@ int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset, uint16_t svid, uint16_t ssid); +PCIDevice *pci_bridge_to_pci(PCIBridge *br); PCIDevice *pci_bridge_get_device(PCIBus *bus); PCIBus *pci_bridge_get_sec_bus(PCIBridge *br); -- 1.7.1.1