[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/15] vl: Make current_machine a local variable
From: |
Alistair Francis |
Subject: |
Re: [PATCH 15/15] vl: Make current_machine a local variable |
Date: |
Tue, 14 Jan 2020 12:00:30 +1000 |
On Fri, Jan 10, 2020 at 1:34 AM Philippe Mathieu-Daudé
<address@hidden> wrote:
>
> Since we now only use current_machine in vl.c, stop exporting
> it as a global variable in "hw/board.h", and make it static
> to vl.c.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> include/hw/boards.h | 2 --
> vl.c | 4 ++--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 61f8bb8e5a..b0c0d4376d 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -59,8 +59,6 @@ void memory_region_allocate_system_memory(MemoryRegion *mr,
> Object *owner,
> #define MACHINE_CLASS(klass) \
> OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
>
> -extern MachineState *current_machine;
> -
> void machine_run_board_init(MachineState *machine);
> bool machine_usb(MachineState *machine);
> int machine_phandle_start(MachineState *machine);
> diff --git a/vl.c b/vl.c
> index 3ff3548183..7a69af4bef 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -214,6 +214,8 @@ static int default_sdcard = 1;
> static int default_vga = 1;
> static int default_net = 1;
>
> +static MachineState *current_machine;
> +
> static struct {
> const char *driver;
> int *flag;
> @@ -1164,8 +1166,6 @@ static int usb_parse(const char *cmdline)
> /***********************************************************/
> /* machine registration */
>
> -MachineState *current_machine;
> -
> static MachineClass *find_machine(const char *name, GSList *machines)
> {
> GSList *el;
> --
> 2.21.1
>
>
- Re: [PATCH 10/15] memory: 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
- [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 15/15] vl: Make current_machine a local variable,
Alistair Francis <=
- Re: [PATCH 00/15] Replace current_machine by qdev_get_machine(), Markus Armbruster, 2020/01/21