migration: fix dump-vmstate with modules

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: 7ab6e7fcce ("qdev: device module support")
Cc: kraxel@redhat.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211116072840.132731-1-lvivier@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Laurent Vivier 2021-11-16 08:28:40 +01:00 committed by Gerd Hoffmann
parent 2e572baf65
commit 4067691a2f

View File

@ -3766,6 +3766,7 @@ void qemu_init(int argc, char **argv, char **envp)
if (vmstate_dump_file) { if (vmstate_dump_file) {
/* dump and exit */ /* dump and exit */
module_load_qom_all();
dump_vmstate_json_to_file(vmstate_dump_file); dump_vmstate_json_to_file(vmstate_dump_file);
exit(0); exit(0);
} }