diff mbox series

[1/3] i386/kvm: Require KVM_CAP_IRQ_ROUTING

Message ID 20200922201922.2153598-2-ehabkost@redhat.com
State New
Headers show
Series i386/kvm: Assume IRQ routing is always available | expand

Commit Message

Eduardo Habkost Sept. 22, 2020, 8:19 p.m. UTC
KVM_CAP_IRQ_ROUTING is available since 2009 (Linux v2.6.30), so
it's safe to just make it a requirement on x86.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 9efb07e7c83..d884ff1b071 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -2129,6 +2129,11 @@  int kvm_arch_init(MachineState *ms, KVMState *s)
     int ret;
     struct utsname utsname;
 
+    if (!kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
+        error_report("kvm: KVM_CAP_IRQ_ROUTING not supported by KVM");
+        return -ENOTSUP;
+    }
+
     has_xsave = kvm_check_extension(s, KVM_CAP_XSAVE);
     has_xcrs = kvm_check_extension(s, KVM_CAP_XCRS);
     has_pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);