From ce7cdebdb583c8dd20e74c977f61c91b8d4333ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 21 Jan 2020 12:03:47 +0100 Subject: accel: Introduce the current_accel() wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20200121110349.25842-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- accel/accel.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'accel') 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; -- cgit v1.2.3