qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH v4 13/17] spapr_pci: create DRConnectors for each PCI


From: Michael Roth
Subject: [Qemu-ppc] [PATCH v4 13/17] spapr_pci: create DRConnectors for each PCI slot during PHB realize
Date: Tue, 23 Dec 2014 06:30:27 -0600

These will be used to support hotplug/unplug of PCI devices to the PCI
bus associated with a particular PHB.

Signed-off-by: Michael Roth <address@hidden>
---
 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 4850f9a..73e86a4 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;
@@ -622,6 +624,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 << 8) | (i << 3));
+        }
+    }
+
     if (!info->finish_realize) {
         error_setg(errp, "finish_realize not defined");
         return;
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]