From: Alex Williamson <alex.williamson@redhat.com>
To: aliguori@us.ibm.com
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH for-1.3] vfio-pci: Fix KVM disabled path
Date: Tue, 27 Nov 2012 12:45:18 -0700 [thread overview]
Message-ID: <20121127194314.2422.65587.stgit@bling.home> (raw)
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 <alex.williamson@redhat.com>
---
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);
}
next reply other threads:[~2012-11-27 19:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 19:45 Alex Williamson [this message]
2012-11-30 18:57 ` [Qemu-devel] [PATCH for-1.3] vfio-pci: Fix KVM disabled path Peter Maydell
2012-11-30 19:14 ` Alex Williamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121127194314.2422.65587.stgit@bling.home \
--to=alex.williamson@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).