From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJl2y-0003xX-61 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 11:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJl2q-0003B9-Jg for qemu-devel@nongnu.org; Tue, 19 Aug 2014 11:10:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJl2q-0003Ay-Bd for qemu-devel@nongnu.org; Tue, 19 Aug 2014 11:09:56 -0400 Message-ID: <53F368A2.1030409@redhat.com> Date: Tue, 19 Aug 2014 17:09:22 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1408453707-9972-1-git-send-email-arei.gonglei@huawei.com> <1408453707-9972-3-git-send-email-arei.gonglei@huawei.com> <1408459079.13594.29.camel@localhost.localdomain> In-Reply-To: <1408459079.13594.29.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] pci: add check for pcie root ports and downstream ports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , arei.gonglei@huawei.com Cc: peter.crosthwaite@xilinx.com, weidong.huang@huawei.com, mst@redhat.com, armbru@redhat.com, luonengjun@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, imammedo@redhat.com, afaerber@suse.de Il 19/08/2014 16:37, Marcel Apfelbaum ha scritto: >> > +static int pci_check_pcie_port(PCIBus *bus, PCIDevice *dev) >> > +{ >> > + Object *obj = OBJECT(bus); >> > + >> > + if (!strcmp(object_get_typename(obj), TYPE_PCIE_BUS)) { > Maybe there is another way to check that this is a PCIe bus? > It's object_dynamic_cast. Paolo