mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
23b0898e44
commit
4376c40ded
9 changed files with 39 additions and 30 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue