aboutsummaryrefslogtreecommitdiff
path: root/accel/accel.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-01-21 12:03:47 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-24 20:59:11 +0100
commitce7cdebdb583c8dd20e74c977f61c91b8d4333ef (patch)
tree698f3156e5aaa069c391fab1c098bf62697d2f00 /accel/accel.c
parent89d337fdd207a378df55a5811347b31bca83e117 (diff)
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>
Diffstat (limited to 'accel/accel.c')
-rw-r--r--accel/accel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/accel/accel.c b/accel/accel.c
index 1c5c3a6abb..cb555e3b06 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -63,6 +63,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
return ret;
}
+AccelState *current_accel(void)
+{
+ return current_machine->accelerator;
+}
+
void accel_setup_post(MachineState *ms)
{
AccelState *accel = ms->accelerator;