mirror of https://github.com/proxmox/mirror_qemu
accel: Introduce the current_accel() wrapper
The accel/ code only accesses the MachineState::accel field. As we simply want to access the accelerator, not the machine, add a current_accel() wrapper. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20200121110349.25842-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>master
parent
89d337fdd2
commit
ce7cdebdb5
|
@ -63,6 +63,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccelState *current_accel(void)
|
||||||
|
{
|
||||||
|
return current_machine->accelerator;
|
||||||
|
}
|
||||||
|
|
||||||
void accel_setup_post(MachineState *ms)
|
void accel_setup_post(MachineState *ms)
|
||||||
{
|
{
|
||||||
AccelState *accel = ms->accelerator;
|
AccelState *accel = ms->accelerator;
|
||||||
|
|
|
@ -70,4 +70,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms);
|
||||||
/* Called just before os_setup_post (ie just before drop OS privs) */
|
/* Called just before os_setup_post (ie just before drop OS privs) */
|
||||||
void accel_setup_post(MachineState *ms);
|
void accel_setup_post(MachineState *ms);
|
||||||
|
|
||||||
|
AccelState *current_accel(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue