diff mbox series

[PULL,4/9] i386/kvm: Require KVM_CAP_IRQ_ROUTING

Message ID 20201015164501.462775-5-ehabkost@redhat.com
State Superseded
Headers show
Series x86 queue, 2020-10-15 | expand

Commit Message

Eduardo Habkost Oct. 15, 2020, 4:44 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>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200922201922.2153598-2-ehabkost@redhat.com>
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 0098be7015..69c691ad77 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -2114,6 +2114,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);