diff mbox series

migration: fix dump-vmstate with modules

Message ID 20211116072840.132731-1-lvivier@redhat.com
State New
Headers show
Series migration: fix dump-vmstate with modules | expand

Commit Message

Laurent Vivier Nov. 16, 2021, 7:28 a.m. UTC
To work correctly -dump-vmstate and vmstate-static-checker.py need to
dump all the supported vmstates.

But as some devices can be modules, they are not loaded at startup and not
dumped. Fix that by loading all available modules before dumping the
machine vmstate.

Fixes: 7ab6e7fcce97 ("qdev: device module support")
Cc: kraxel@redhat.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 softmmu/vl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Philippe Mathieu-Daudé Nov. 16, 2021, 8:19 a.m. UTC | #1
On 11/16/21 08:28, Laurent Vivier wrote:
> To work correctly -dump-vmstate and vmstate-static-checker.py need to
> dump all the supported vmstates.
> 
> But as some devices can be modules, they are not loaded at startup and not
> dumped. Fix that by loading all available modules before dumping the
> machine vmstate.
> 
> Fixes: 7ab6e7fcce97 ("qdev: device module support")
> Cc: kraxel@redhat.com
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  softmmu/vl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 1159a64bce4e..620a1f1367e2 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3766,6 +3766,7 @@ void qemu_init(int argc, char **argv, char **envp)
>  
>      if (vmstate_dump_file) {
>          /* dump and exit */
> +        module_load_qom_all();
>          dump_vmstate_json_to_file(vmstate_dump_file);
>          exit(0);
>      }
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Laurent Vivier Nov. 21, 2021, 4:23 p.m. UTC | #2
I think it would be good to have this in 6.2

Thanks,
Laurent

On 16/11/2021 08:28, Laurent Vivier wrote:
> To work correctly -dump-vmstate and vmstate-static-checker.py need to
> dump all the supported vmstates.
> 
> But as some devices can be modules, they are not loaded at startup and not
> dumped. Fix that by loading all available modules before dumping the
> machine vmstate.
> 
> Fixes: 7ab6e7fcce97 ("qdev: device module support")
> Cc: kraxel@redhat.com
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>   softmmu/vl.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 1159a64bce4e..620a1f1367e2 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3766,6 +3766,7 @@ void qemu_init(int argc, char **argv, char **envp)
>   
>       if (vmstate_dump_file) {
>           /* dump and exit */
> +        module_load_qom_all();
>           dump_vmstate_json_to_file(vmstate_dump_file);
>           exit(0);
>       }
>
diff mbox series

Patch

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 1159a64bce4e..620a1f1367e2 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3766,6 +3766,7 @@  void qemu_init(int argc, char **argv, char **envp)
 
     if (vmstate_dump_file) {
         /* dump and exit */
+        module_load_qom_all();
         dump_vmstate_json_to_file(vmstate_dump_file);
         exit(0);
     }