qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 06/15] migration/savevm: Replace current_machine by qdev_get_


From: Dr. David Alan Gilbert
Subject: Re: [PATCH 06/15] migration/savevm: Replace current_machine by qdev_get_machine()
Date: Thu, 9 Jan 2020 15:52:38 +0000
User-agent: Mutt/1.13.0 (2019-11-30)

* Philippe Mathieu-Daudé (address@hidden) wrote:
> As we want to remove the global current_machine,
> replace MACHINE_GET_CLASS(current_machine) by
> MACHINE_GET_CLASS(qdev_get_machine()).
> 
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  migration/savevm.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 59efc1981d..0e8b6a4715 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -292,7 +292,8 @@ static uint32_t get_validatable_capabilities_count(void)
>  static int configuration_pre_save(void *opaque)
>  {
>      SaveState *state = opaque;
> -    const char *current_name = MACHINE_GET_CLASS(current_machine)->name;
> +    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
> +    const char *current_name = mc->name;

For migration:

Acked-by: Dr. David Alan Gilbert <address@hidden>

(Personally I'd keep it on one line, but that's just taste)


>      MigrationState *s = migrate_get_current();
>      int i, j;
>  
> @@ -362,7 +363,8 @@ static bool configuration_validate_capabilities(SaveState 
> *state)
>  static int configuration_post_load(void *opaque, int version_id)
>  {
>      SaveState *state = opaque;
> -    const char *current_name = MACHINE_GET_CLASS(current_machine)->name;
> +    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
> +    const char *current_name = mc->name;
>  
>      if (strncmp(state->name, current_name, state->len) != 0) {
>          error_report("Machine type received is '%.*s' and local is '%s'",
> @@ -615,9 +617,7 @@ static void dump_vmstate_vmsd(FILE *out_file,
>  
>  static void dump_machine_type(FILE *out_file)
>  {
> -    MachineClass *mc;
> -
> -    mc = MACHINE_GET_CLASS(current_machine);
> +    MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
>  
>      fprintf(out_file, "  \"vmschkmachine\": {\n");
>      fprintf(out_file, "    \"Name\": \"%s\"\n", mc->name);
> -- 
> 2.21.1
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]