diff mbox

[10/16] kvm: Support MSI convert to INTx in device assignment

Message ID 1236865019-30321-11-git-send-email-sheng@linux.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Sheng Yang March 12, 2009, 1:36 p.m. UTC
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 qemu/hw/device-assignment.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index bda0e95..01485d7 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -588,7 +588,11 @@  static int assign_irq(AssignedDevInfo *adev)
     assigned_irq_data.guest_irq = irq;
     assigned_irq_data.host_irq = dev->real_device.irq;
 #ifdef KVM_CAP_ASSIGN_DEV_IRQ
-    assigned_irq_data.flags = KVM_DEV_IRQ_HOST_INTX | KVM_DEV_IRQ_GUEST_INTX;
+    if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSI)
+        assigned_irq_data.flags = KVM_DEV_IRQ_HOST_MSI | KVM_DEV_IRQ_GUEST_INTX;
+    else
+        assigned_irq_data.flags = KVM_DEV_IRQ_HOST_INTX | KVM_DEV_IRQ_GUEST_INTX;
+
     r = kvm_deassign_irq(kvm_context, &assigned_irq_data);
     /* -ENXIO means no assigned irq */
     if (r && r != -ENXIO)