diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-11-13 11:17:12 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:45 +0100 |
commit | 4376c40dedb22530738eeb104a603e94ed03f719 (patch) | |
tree | 2749159f46643a7e1e2f74ecd9491f189976c93f /accel/kvm | |
parent | 23b0898e4471f42e62aa1fea304f6a6e23d03310 (diff) |
kvm: introduce kvm_kernel_irqchip_* functions
The KVMState struct is opaque, so provide accessors for the fields
that will be moved from current_machine to the accelerator. For now
they just forward to the machine object, but this will change.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm')
-rw-r--r-- | accel/kvm/kvm-all.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4770dd8c67..34e8f26d6a 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1774,7 +1774,7 @@ void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi) g_hash_table_insert(s->gsimap, irq, GINT_TO_POINTER(gsi)); } -static void kvm_irqchip_create(MachineState *machine, KVMState *s) +static void kvm_irqchip_create(KVMState *s) { int ret; @@ -1792,9 +1792,9 @@ static void kvm_irqchip_create(MachineState *machine, KVMState *s) /* First probe and see if there's a arch-specific hook to create the * in-kernel irqchip for us */ - ret = kvm_arch_irqchip_create(machine, s); + ret = kvm_arch_irqchip_create(s); if (ret == 0) { - if (machine_kernel_irqchip_split(machine)) { + if (kvm_kernel_irqchip_split()) { perror("Split IRQ chip mode not supported."); exit(1); } else { @@ -2066,7 +2066,7 @@ static int kvm_init(MachineState *ms) } if (machine_kernel_irqchip_allowed(ms)) { - kvm_irqchip_create(ms, s); + kvm_irqchip_create(s); } if (kvm_eventfds_allowed) { @@ -2983,6 +2983,21 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v, s->kvm_shadow_mem = value; } +bool kvm_kernel_irqchip_allowed(void) +{ + return machine_kernel_irqchip_allowed(current_machine); +} + +bool kvm_kernel_irqchip_required(void) +{ + return machine_kernel_irqchip_required(current_machine); +} + +bool kvm_kernel_irqchip_split(void) +{ + return machine_kernel_irqchip_split(current_machine); +} + static void kvm_accel_instance_init(Object *obj) { KVMState *s = KVM_STATE(obj); |