From patchwork Mon Feb 16 14:27:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 440157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 13F7D1401D0 for ; Tue, 17 Feb 2015 01:34:20 +1100 (AEDT) Received: from localhost ([::1]:39900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNMkc-0000U9-9M for incoming@patchwork.ozlabs.org; Mon, 16 Feb 2015 09:34:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNMgR-0001MS-1z for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:30:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNMgL-0004iF-Sq for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:29:58 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:56409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNMgL-0004hl-MD for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:29:53 -0500 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Feb 2015 07:29:53 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 16 Feb 2015 07:29:50 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 809463E40030; Mon, 16 Feb 2015 07:25:54 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1GETihY35913862; Mon, 16 Feb 2015 07:29:52 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1GETEt9020601; Mon, 16 Feb 2015 07:29:16 -0700 Received: from localhost ([9.80.84.249]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1GETD01020247; Mon, 16 Feb 2015 07:29:14 -0700 From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 16 Feb 2015 08:27:48 -0600 Message-Id: <1424096872-29868-13-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424096872-29868-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1424096872-29868-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021614-0009-0000-0000-000008CDAB09 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.151 Cc: aik@ozlabs.ru, agraf@suse.de, ncmike@ncultra.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au Subject: [Qemu-devel] [PATCH v5 12/16] spapr_pci: create DRConnectors for each PCI slot during PHB realize 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 These will be used to support hotplug/unplug of PCI devices to the PCI bus associated with a particular PHB. Reviewed-by: David Gibson Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index ab67715..7ee6f9e 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -47,6 +47,8 @@ #define RTAS_TYPE_MSI 1 #define RTAS_TYPE_MSIX 2 +#include "hw/ppc/spapr_drc.h" + static sPAPRPHBState *find_phb(sPAPREnvironment *spapr, uint64_t buid) { sPAPRPHBState *sphb; @@ -628,6 +630,15 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) sphb->lsi_table[i].irq = irq; } + /* allocate connectors for child PCI devices */ + if (sphb->dr_enabled) { + for (i = 0; i < PCI_SLOT_MAX; i++) { + spapr_dr_connector_new(OBJECT(phb), + SPAPR_DR_CONNECTOR_TYPE_PCI, + (sphb->index << 16) | (i << 3)); + } + } + if (!info->finish_realize) { error_setg(errp, "finish_realize not defined"); return;