X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=vl.c;h=c696ad2a13d4ed59c594976d3b073e741e81a949;hb=13c24edaa742181af8d9c6b027ee366b04de1ea1;hp=c22ca447fa480673e9ecfbddad5e8b2965c4d3c4;hpb=d11bf9bf0fd66057aa5e8acb1bbc797419d5a4e6;p=mirror_qemu.git diff --git a/vl.c b/vl.c index c22ca447fa..c696ad2a13 100644 --- a/vl.c +++ b/vl.c @@ -185,7 +185,7 @@ const char *prom_envs[MAX_PROM_ENVS]; int boot_menu; bool boot_strict; uint8_t *boot_splash_filedata; -size_t boot_splash_filedata_size; +int only_migratable; /* turn it off unless user states otherwise */ bool wakeup_suspend_enabled; int icount_align_option; @@ -3120,6 +3120,7 @@ int main(int argc, char **argv, char **envp) if (optind >= argc) break; if (argv[optind][0] != '-') { + loc_set_cmdline(argv, optind, 1); drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS); } else { const QEMUOption *popt; @@ -3202,7 +3203,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_CURSES dpy.type = DISPLAY_TYPE_CURSES; #else - error_report("curses support is disabled"); + error_report("curses or iconv support is disabled"); exit(1); #endif break; @@ -3286,9 +3287,12 @@ int main(int argc, char **argv, char **envp) add_device_config(DEV_BT, optarg); break; case QEMU_OPTION_audio_help: - AUD_help (); + audio_legacy_help(); exit (0); break; + case QEMU_OPTION_audiodev: + audio_parse_option(optarg); + break; case QEMU_OPTION_soundhw: select_soundhw (optarg); break; @@ -3797,13 +3801,7 @@ int main(int argc, char **argv, char **envp) incoming = optarg; break; case QEMU_OPTION_only_migratable: - /* - * TODO: we can remove this option one day, and we - * should all use: - * - * "-global migration.only-migratable=true" - */ - qemu_global_option("migration.only-migratable=true"); + only_migratable = 1; break; case QEMU_OPTION_nodefaults: has_defaults = 0; @@ -4274,6 +4272,13 @@ int main(int argc, char **argv, char **envp) exit(0); } + /* + * Note: we need to create block backends before + * machine_set_property(), so machine properties can refer to + * them. + */ + configure_blockdev(&bdo_queue, machine_class, snapshot); + machine_opts = qemu_get_machine_opts(); qemu_opt_foreach(machine_opts, machine_set_property, current_machine, &error_fatal); @@ -4281,16 +4286,36 @@ int main(int argc, char **argv, char **envp) current_machine->maxram_size = maxram_size; current_machine->ram_slots = ram_slots; + /* + * Note: uses machine properties such as kernel-irqchip, must run + * after machine_set_property(). + */ configure_accelerator(current_machine, argv[0]); + /* + * Beware, QOM objects created before this point miss global and + * compat properties. + * + * Global properties get set up by qdev_prop_register_global(), + * called from user_register_global_props(), and certain option + * desugaring. Also in CPU feature desugaring (buried in + * parse_cpu_model()), which happens below this point, but may + * only target the CPU type, which can only be created after + * parse_cpu_model() returned the type. + * + * Machine compat properties: object_set_machine_compat_props(). + * Accelerator compat props: object_set_accelerator_compat_props(), + * called from configure_accelerator(). + */ + if (!qtest_enabled() && machine_class->deprecation_reason) { error_report("Machine type '%s' is deprecated: %s", machine_class->name, machine_class->deprecation_reason); } /* - * Migration object can only be created after global properties - * are applied correctly. + * Note: creates a QOM object, must run only after global and + * compat properties have been set up. */ migration_object_init(); @@ -4400,8 +4425,6 @@ int main(int argc, char **argv, char **envp) ram_mig_init(); dirty_bitmap_mig_init(); - configure_blockdev(&bdo_queue, machine_class, snapshot); - qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, &error_fatal); @@ -4450,6 +4473,8 @@ int main(int argc, char **argv, char **envp) /* do monitor/qmp handling at preconfig state if requested */ main_loop(); + audio_init_audiodevs(); + /* from here on runstate is RUN_STATE_PRELAUNCH */ machine_run_board_init(current_machine);