summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-08-15 12:08:13 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2012-09-11 18:15:15 -0300
commit8732fbd2afce18afc429da2ad76df7c48b4bac4b (patch)
treea48cb0fa41deab8919449d60332888e782996e00 /kvm-all.c
parent2879636d55312b5391ec46c7dee5d3a07714c222 (diff)
downloadqemu-8732fbd2afce18afc429da2ad76df7c48b4bac4b.tar.gz
qemu-8732fbd2afce18afc429da2ad76df7c48b4bac4b.tar.bz2
qemu-8732fbd2afce18afc429da2ad76df7c48b4bac4b.zip
kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()
Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for architectures that support async interrupt notification even without an in kernel irqchip). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 39cff55f5b..f9873db4af 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1237,10 +1237,6 @@ static int kvm_irqchip_create(KVMState *s)
return ret;
}
- s->irqchip_inject_ioctl = KVM_IRQ_LINE;
- if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
- s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
- }
kvm_kernel_irqchip = true;
/* If we have an in-kernel IRQ chip then we must have asynchronous
* interrupt delivery (though the reverse is not necessarily true)
@@ -1389,6 +1385,11 @@ int kvm_init(void)
s->intx_set_mask = kvm_check_extension(s, KVM_CAP_PCI_2_3);
+ s->irqchip_inject_ioctl = KVM_IRQ_LINE;
+ if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
+ s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
+ }
+
ret = kvm_arch_init(s);
if (ret < 0) {
goto err;