Move the first argv pass ahead of MODULE_INIT_TARGET_INFO so later target-info selection can use command-line options before QOM init.
Signed-off-by: Yonggang Luo <[email protected]> --- system/vl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/system/vl.c b/system/vl.c index 468a9fc247a..3efa4968a20 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2912,16 +2912,6 @@ void qemu_init(int argc, char **argv) error_init(argv[0]); qemu_init_exec_dir(argv[0]); - os_setup_limits(); - - module_call_init(MODULE_INIT_TARGET_INFO); - target_info_qom_set_target(); - - module_init_info(qemu_modinfo); - module_allow_arch(target_name()); - - qemu_init_subsystems(); - /* first pass of option parsing */ optind = 1; while (optind < argc) { @@ -2940,6 +2930,16 @@ void qemu_init(int argc, char **argv) } } + os_setup_limits(); + + module_call_init(MODULE_INIT_TARGET_INFO); + target_info_qom_set_target(); + + module_init_info(qemu_modinfo); + module_allow_arch(target_name()); + + qemu_init_subsystems(); + machine_opts_dict = qdict_new(); if (userconfig) { qemu_read_default_config_file(&error_fatal); -- 2.52.0.windows.1
