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

[Xen-devel] [PATCH v2 25/30] xen/x86: add all PCI devices to PVHv2 Dom0



Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/domain_build.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 407f742..b4a14a3 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -2378,6 +2378,25 @@ static int __init hvm_setup_acpi(struct domain *d)
     return 0;
 }
 
+static int __init hvm_setup_pci(struct domain *d)
+{
+    struct pci_dev *pdev;
+    int rc;
+
+    printk("** Adding PCI devices **\n");
+
+    pcidevs_lock();
+    list_for_each_entry( pdev, &d->arch.pdev_list, domain_list )
+    {
+        rc = hwdom_add_device(pdev);
+        if ( rc )
+            return rc;
+    }
+    pcidevs_unlock();
+
+    return 0;
+}
+
 static int __init construct_dom0_hvm(struct domain *d, const module_t *image,
                                      unsigned long image_headroom,
                                      module_t *initrd,
@@ -2426,6 +2445,13 @@ static int __init construct_dom0_hvm(struct domain *d, 
const module_t *image,
         return rc;
     }
 
+    rc = hvm_setup_pci(d);
+    if ( rc )
+    {
+        printk("Failed to add PCI devices: %d\n", rc);
+        return rc;
+    }
+
     return 0;
 }
 
-- 
2.7.4 (Apple Git-66)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.