[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/15] accel: Introduce the current_accel() method
From: |
Alistair Francis |
Subject: |
Re: [PATCH 12/15] accel: Introduce the current_accel() method |
Date: |
Tue, 14 Jan 2020 11:59:07 +1000 |
On Fri, Jan 10, 2020 at 1:27 AM Philippe Mathieu-Daudé
<address@hidden> wrote:
>
> We want to remove the global current_machine. The accel/
> code access few times current_machine->accelerator. Introduce
> the current_accel() method first, it will then be easier to
> replace 'current_machine' by MACHINE(qdev_get_machine()).
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> include/sysemu/accel.h | 2 ++
> accel/accel.c | 5 +++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
> index d4c1429711..47e5788530 100644
> --- a/include/sysemu/accel.h
> +++ b/include/sysemu/accel.h
> @@ -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
> 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;
> --
> 2.21.1
>
>
- Re: [PATCH 08/15] target/arm/monitor: Replace current_machine by qdev_get_machine(), (continued)
- [PATCH 11/15] exec: Replace current_machine by qdev_get_machine(), Philippe Mathieu-Daudé, 2020/01/09
- [PATCH 12/15] accel: Introduce the current_accel() method, Philippe Mathieu-Daudé, 2020/01/09
- Re: [PATCH 12/15] accel: Introduce the current_accel() method,
Alistair Francis <=
- [PATCH 13/15] accel: Replace current_machine->accelerator by current_accel() method, Philippe Mathieu-Daudé, 2020/01/09
- [PATCH 14/15] accel/accel: Replace current_machine by qdev_get_machine(), Philippe Mathieu-Daudé, 2020/01/09
- [PATCH 15/15] vl: Make current_machine a local variable, Philippe Mathieu-Daudé, 2020/01/09
- Re: [PATCH 00/15] Replace current_machine by qdev_get_machine(), Markus Armbruster, 2020/01/21