]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel: Introduce the current_accel() wrapper
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 21 Jan 2020 11:03:47 +0000 (12:03 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jan 2020 19:59:11 +0000 (20:59 +0100)
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>
accel/accel.c
include/sysemu/accel.h

index 1c5c3a6abb90b56d911d9776ed894f6de580f78a..cb555e3b06c6189d8b330dd1b4ecf93d1ed2ce13 100644 (file)
@@ -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;
index d4c142971195612944751cdbfa9872a3fb348af2..47e5788530cd80c3692407a03e171f75f68dcd27 100644 (file)
@@ -70,4 +70,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms);
 /* Called just before os_setup_post (ie just before drop OS privs) */
 void accel_setup_post(MachineState *ms);
 
+AccelState *current_accel(void);
+
 #endif