[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] vl.c: make current_machine as no
From: |
Thomas Huth |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] vl.c: make current_machine as non-global variable |
Date: |
Tue, 2 Apr 2019 09:16:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 |
On 02/04/2019 07.55, Like Xu wrote:
> This patch makes the remaining dozen or so uses of the global
> current_machine outside vl.c use qdev_get_machine() instead,
> and then make current_machine local to vl.c instead of global.
>
> Signed-off-by: Like Xu <address@hidden>
> ---
[...]
> --- a/vl.c
> +++ b/vl.c
> @@ -1265,6 +1265,8 @@ static QemuOptsList qemu_smp_opts = {
> },
> };
>
> +MachineState *current_machine;
To be sure that it is only used here, could you please also make the
variable "static"?
Thanks,
Thomas
> +
> static void smp_parse(QemuOpts *opts)
> {
> if (opts) {
> @@ -1462,8 +1464,6 @@ static int usb_parse(const char *cmdline)
> /***********************************************************/
> /* machine registration */
>
> -MachineState *current_machine;
> -
> static MachineClass *find_machine(const char *name)
> {
> GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
>