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

[Xen-devel] [PATCH 3/6] [events] Check if the PCI device is owner by a domain different than DOMID_SELF.



We check if there is a domain owner for the PCI device. In case of failure
(meaning no domain has registered for this device) we make
DOMID_SELF the owner.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/events.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index f8bbf4c..d122022 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -39,6 +39,7 @@
 #include <asm/sync_bitops.h>
 #include <asm/xen/hypercall.h>
 #include <asm/xen/hypervisor.h>
+#include <asm/xen/pci.h>
 
 #include <xen/xen-ops.h>
 #include <xen/events.h>
@@ -633,10 +634,14 @@ int xen_create_msi_irq(struct pci_dev *dev, struct 
msi_desc *msidesc,
        int irq = 0;
        struct physdev_map_pirq map_irq;
        int rc;
-       domid_t domid = DOMID_SELF;
+       domid_t domid;
        int pos;
        u32 table_offset, bir;
 
+       domid = rc = find_device_owner(dev);
+       if (rc < 0)
+               domid = DOMID_SELF;
+       
        memset(&map_irq, 0, sizeof(map_irq));
        map_irq.domid = domid;
        map_irq.type = MAP_PIRQ_TYPE_MSI;
-- 
1.6.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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