qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH for-1.3] vfio-pci: Fix KVM disabled path


From: Alex Williamson
Subject: [Qemu-devel] [PATCH for-1.3] vfio-pci: Fix KVM disabled path
Date: Tue, 27 Nov 2012 12:45:18 -0700
User-agent: StGit/0.16

kvm_check_extension() explodes when KVM isn't enabled so we need to
first test whether KVM is enabled.  Use kvm_irqchip_in_kernel() for
this since it matches the test we do before using this result.

Signed-off-by: Alex Williamson <address@hidden>
---
 hw/vfio_pci.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Anthony, please include this for 1.3.  Let me know if you prefer a
pull request.  Thanks,

Alex

diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c
index 7c27834..2acc757 100644
--- a/hw/vfio_pci.c
+++ b/hw/vfio_pci.c
@@ -438,7 +438,8 @@ static int vfio_enable_intx(VFIODevice *vdev)
      * Only conditional to avoid generating error messages on platforms
      * where we won't actually use the result anyway.
      */
-    if (kvm_check_extension(kvm_state, KVM_CAP_IRQFD_RESAMPLE)) {
+    if (kvm_irqchip_in_kernel() &&
+        kvm_check_extension(kvm_state, KVM_CAP_IRQFD_RESAMPLE)) {
         vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev,
                                                         vdev->intx.pin);
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]