From 3d4b26494fdce89354dac49ef909356ccda77914 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 31 Jan 2012 19:17:52 +0100 Subject: kvm: Implement kvm_irqchip_in_kernel like kvm_enabled To both avoid that kvm_irqchip_in_kernel always has to be paired with kvm_enabled and that the former ends up in a function call, implement it like the latter. This means keeping the state in a global variable and defining kvm_irqchip_in_kernel as a preprocessor macro. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- hw/pc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/pc.c') diff --git a/hw/pc.c b/hw/pc.c index 7f3aa65..3b35735 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -889,7 +889,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id) DeviceState *dev; static int apic_mapped; - if (kvm_enabled() && kvm_irqchip_in_kernel()) { + if (kvm_irqchip_in_kernel()) { dev = qdev_create(NULL, "kvm-apic"); } else { dev = qdev_create(NULL, "apic"); @@ -908,7 +908,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id) } /* KVM does not support MSI yet. */ - if (!kvm_enabled() || !kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_in_kernel()) { msi_supported = true; } -- cgit v1.1