diff mbox series

[08/15] target/arm/monitor: Replace current_machine by qdev_get_machine()

Message ID 20200109152133.23649-9-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series Replace current_machine by qdev_get_machine() | expand

Commit Message

Philippe Mathieu-Daudé Jan. 9, 2020, 3:21 p.m. UTC
As we want to remove the global current_machine,
replace 'current_machine' by MACHINE(qdev_get_machine()).

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/arm/monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alistair Francis Jan. 12, 2020, 9:47 a.m. UTC | #1
On Thu, Jan 9, 2020 at 11:23 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> As we want to remove the global current_machine,
> replace 'current_machine' by MACHINE(qdev_get_machine()).
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/arm/monitor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target/arm/monitor.c b/target/arm/monitor.c
> index fa054f8a36..bcbf69802d 100644
> --- a/target/arm/monitor.c
> +++ b/target/arm/monitor.c
> @@ -136,7 +136,8 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
>      }
>
>      if (kvm_enabled()) {
> -        const char *cpu_type = current_machine->cpu_type;
> +        MachineState *ms = MACHINE(qdev_get_machine());
> +        const char *cpu_type = ms->cpu_type;
>          int len = strlen(cpu_type) - strlen(ARM_CPU_TYPE_SUFFIX);
>          bool supported = false;
>
> --
> 2.21.1
>
>
diff mbox series

Patch

diff --git a/target/arm/monitor.c b/target/arm/monitor.c
index fa054f8a36..bcbf69802d 100644
--- a/target/arm/monitor.c
+++ b/target/arm/monitor.c
@@ -136,7 +136,8 @@  CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
     }
 
     if (kvm_enabled()) {
-        const char *cpu_type = current_machine->cpu_type;
+        MachineState *ms = MACHINE(qdev_get_machine());
+        const char *cpu_type = ms->cpu_type;
         int len = strlen(cpu_type) - strlen(ARM_CPU_TYPE_SUFFIX);
         bool supported = false;