KVM: x86: add kvm_apic_map_get_dest_lapic
authorRadim Krčmář <rkrcmar@redhat.com>
Tue, 12 Jul 2016 20:09:18 +0000 (22:09 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Jul 2016 07:03:51 +0000 (09:03 +0200)
commit64aa47bfc45323040d5db8f30cbd6851f2606c7d
treed925b3525c76fde3eab4e3f9b120b2613152945c
parent757883de41eca292765578ef87c4f49453529bb2
KVM: x86: add kvm_apic_map_get_dest_lapic

kvm_irq_delivery_to_apic_fast and kvm_intr_is_single_vcpu_fast both
compute the interrupt destination.  Factor the code.

'struct kvm_lapic **dst = NULL' had to be added to silence GCC.
GCC might complain about potential NULL access in the future, because it
missed conditions that avoided uninitialized uses of dst.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c