From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGGDG-0001nK-HV for qemu-devel@nongnu.org; Thu, 14 Mar 2013 18:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGGDE-0001sO-UC for qemu-devel@nongnu.org; Thu, 14 Mar 2013 18:01:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGGDE-0001sB-Nf for qemu-devel@nongnu.org; Thu, 14 Mar 2013 18:01:24 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2EM1OoJ011950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Mar 2013 18:01:24 -0400 From: Alex Williamson Date: Thu, 14 Mar 2013 16:01:23 -0600 Message-ID: <20130314220123.10566.87182.stgit@bling.home> In-Reply-To: <20130314215150.10566.37912.stgit@bling.home> References: <20130314215150.10566.37912.stgit@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 5/7] pci: Create pci_bus_is_express helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mst@redhat.com Cc: qemu-devel@nongnu.org For testing the bus type. Signed-off-by: Alex Williamson --- hw/pci/pci.c | 5 +++++ hw/pci/pci.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index f18d3ea..9c394ab 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -297,6 +297,11 @@ static void pci_bus_init(PCIBus *bus, DeviceState *parent, vmstate_register(NULL, -1, &vmstate_pcibus, bus); } +bool pci_bus_is_express(PCIBus *bus) +{ + return object_dynamic_cast(OBJECT(bus), TYPE_PCIE_BUS); +} + void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent, const char *name, MemoryRegion *address_space_mem, diff --git a/hw/pci/pci.h b/hw/pci/pci.h index 10aeaf0..d715e6f 100644 --- a/hw/pci/pci.h +++ b/hw/pci/pci.h @@ -344,6 +344,7 @@ typedef int (*pci_hotplug_fn)(DeviceState *qdev, PCIDevice *pci_dev, #define PCI_BUS(obj) OBJECT_CHECK(PCIBus, (obj), TYPE_PCI_BUS) #define TYPE_PCIE_BUS "PCIE" +bool pci_bus_is_express(PCIBus *bus); void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent, const char *name, MemoryRegion *address_space_mem,