Skip to contentSkip to conversation

kvm: Move device capability init earlier

PATCH Applied Sheng Yang 2 participants 2 messages Mar 19, 2009 KVM

lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

PATCH 1/1 kvm: Move device capability init earlier

For if assign_irq() is called before capability init, it don't know device support MSI or not for the first time calling. So it won't enable MSI2INTx...

---
 qemu/hw/device-assignment.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
qemu/hw/device-assignment.c +5 -5
index 2ee0e47..b7f9fa6 100644
@@ -1149,6 +1149,11 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus)
     pci_init(pacc);
     dev->pdev = pci_get_dev(pacc, 0, adev->bus, adev->dev, adev->func);
 
+    if (pci_enable_capability_support(pci_dev, 0, NULL,
+                    assigned_device_pci_cap_write_config,
+                    assigned_device_pci_cap_init) < 0)
+        goto assigned_out;
+
     /* assign device to guest */
     r = assign_device(adev);
     if (r < 0)
@@ -1159,11 +1164,6 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus)
     if (r < 0)
         goto assigned_out;
 
-    if (pci_enable_capability_support(pci_dev, 0, NULL,
-                    assigned_device_pci_cap_write_config,
-                    assigned_device_pci_cap_init) < 0)
-        goto assigned_out;
-
     /* intercept MSI-X entry page in the MMIO */
     if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSIX)
         if (assigned_dev_register_msix_mmio(dev))
Signature · 1 line
1.5.4.5
Applied
#1 lore raw
Quoted 3 lines · Sheng Yang

For if assign_irq() is called before capability init, it don't know device support MSI or not for the first time calling. So it won't enable MSI2INTx...

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function