qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

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>

authored by

Philippe Mathieu-Daudé and committed by
Paolo Bonzini
ce7cdebd 89d337fd

+7
+5
accel/accel.c
··· 63 63 return ret; 64 64 } 65 65 66 + AccelState *current_accel(void) 67 + { 68 + return current_machine->accelerator; 69 + } 70 + 66 71 void accel_setup_post(MachineState *ms) 67 72 { 68 73 AccelState *accel = ms->accelerator;
+2
include/sysemu/accel.h
··· 70 70 /* Called just before os_setup_post (ie just before drop OS privs) */ 71 71 void accel_setup_post(MachineState *ms); 72 72 73 + AccelState *current_accel(void); 74 + 73 75 #endif