Skip to contentSkip to conversation

xend: passthrough: fix physdev_map_pirq invocation

PATCH New Qing He 1 participant 1 message Sep 4, 2009

lore
Share & tools
lore

Qing He

author
#0 lore raw

PATCH 1/1 xend: passthrough: fix physdev_map_pirq invocation

For those devices not having INTx (like VFs), avoid calling map_pirq, otherwise the guest cannot be started successfully.

Also avoid calling this hypercall for hvm guest, this is done in the device model.

---
 pciif.py |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
tools/python/xen/xend/server/pciif.py +7 -6
diff -r 8f81bdd57afe tools/python/xen/xend/server/pciif.py
@@ -345,12 +345,13 @@ class PciController(DevController):
                 if rc<0:
                     raise VmError(('pci: failed to remove msi-x iomem'))
 
-        rc = xc.physdev_map_pirq(domid = fe_domid,
-                               index = dev.irq,
-                               pirq  = dev.irq)
-        if rc < 0:
-            raise VmError(('pci: failed to map irq on device '+
-                        '%s - errno=%d')%(dev.name,rc))
+        if not self.vm.info.is_hvm() and dev.irq:
+            rc = xc.physdev_map_pirq(domid = fe_domid,
+                                   index = dev.irq,
+                                   pirq  = dev.irq)
+            if rc < 0:
+                raise VmError(('pci: failed to map irq on device '+
+                            '%s - errno=%d')%(dev.name,rc))
         if dev.irq>0:
             log.debug('pci: enabling irq %d'%dev.irq)
             rc = xc.domain_irq_permission(domid =  fe_domid, pirq = dev.irq,