diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2012-01-31 19:17:52 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-02-08 15:57:50 -0200 |
commit | 3d4b26494fdce89354dac49ef909356ccda77914 (patch) | |
tree | 50dae556e5fd2b3a18cd29731ee85c599d2b9260 /hw/pc.c | |
parent | 39d6960aabfd90bf0bf7ba38d69e918962b70b16 (diff) | |
download | qemu-3d4b26494fdce89354dac49ef909356ccda77914.tar.gz qemu-3d4b26494fdce89354dac49ef909356ccda77914.tar.bz2 qemu-3d4b26494fdce89354dac49ef909356ccda77914.zip |
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 <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |