From patchwork Thu Mar 14 22:01:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 227814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC7F82C008C for ; Fri, 15 Mar 2013 09:03:34 +1100 (EST) Received: from localhost ([::1]:39526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGGFI-0004zY-Sx for incoming@patchwork.ozlabs.org; Thu, 14 Mar 2013 18:03:32 -0400 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 Received: from bling.home (ovpn-113-45.phx2.redhat.com [10.3.113.45]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2EM1NVD004838; Thu, 14 Mar 2013 18:01:23 -0400 To: mst@redhat.com 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> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 5/7] pci: Create pci_bus_is_express helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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,