[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before
From: |
Paolo Bonzini |
Subject: |
[PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before 'no default machine' |
Date: |
Mon, 16 Mar 2020 22:26:58 +0100 |
From: Peter Maydell <address@hidden>
Currently if you try to ask for the list of CPUs for a target
architecture which does not specify a default machine type
you just get an error:
$ qemu-system-arm -cpu help
qemu-system-arm: No machine specified, and there is no default
Use -machine help to list supported machines
Since the list of CPUs doesn't depend on the machine, this is
unnecessarily unhelpful. "-device help" has a similar problem.
Move the checks for "did the user ask for -cpu help or -device help"
up so they precede the select_machine() call which checks that the
user specified a valid machine type.
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
softmmu/vl.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ff2685d..6a28592 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3789,6 +3789,22 @@ void qemu_init(int argc, char **argv, char **envp)
*/
loc_set_none();
+ /*
+ * Check for -cpu help and -device help before we call select_machine(),
+ * which will return an error if the architecture has no default machine
+ * type and the user did not specify one, so that the user doesn't need
+ * to say '-cpu help -machine something'.
+ */
+ if (cpu_option && is_help_option(cpu_option)) {
+ list_cpus(cpu_option);
+ exit(0);
+ }
+
+ if (qemu_opts_foreach(qemu_find_opts("device"),
+ device_help_func, NULL, NULL)) {
+ exit(0);
+ }
+
user_register_global_props();
replay_configure(icount_opts);
@@ -3877,11 +3893,6 @@ void qemu_init(int argc, char **argv, char **envp)
qemu_set_hw_version(machine_class->hw_version);
}
- if (cpu_option && is_help_option(cpu_option)) {
- list_cpus(cpu_option);
- exit(0);
- }
-
if (!trace_init_backends()) {
exit(1);
}
@@ -4112,11 +4123,6 @@ void qemu_init(int argc, char **argv, char **envp)
fsdev_init_func, NULL, &error_fatal);
#endif
- if (qemu_opts_foreach(qemu_find_opts("device"),
- device_help_func, NULL, NULL)) {
- exit(0);
- }
-
/*
* Note: we need to create block backends before
* machine_set_property(), so machine properties can refer to
--
1.8.3.1
- [PULL 20/61] qom/object: Use common get/set uint helpers, (continued)
- [PULL 20/61] qom/object: Use common get/set uint helpers, Paolo Bonzini, 2020/03/16
- [PULL 22/61] WHPX: Use proper synchronization primitives while processing, Paolo Bonzini, 2020/03/16
- [PULL 23/61] Makefile: Align 'help' target output, Paolo Bonzini, 2020/03/16
- [PULL 24/61] Makefile: Let the 'help' target list the tools targets, Paolo Bonzini, 2020/03/16
- [PULL 25/61] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 26/61] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB, Paolo Bonzini, 2020/03/16
- [PULL 27/61] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB, Paolo Bonzini, 2020/03/16
- [PULL 28/61] ui/curses: Make control_characters[] array const, Paolo Bonzini, 2020/03/16
- [PULL 32/61] Use -isystem for linux-headers dir, Paolo Bonzini, 2020/03/16
- [PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before 'no default machine',
Paolo Bonzini <=
- [PULL 33/61] exec/rom_reset: Free rom data during inmigrate skip, Paolo Bonzini, 2020/03/16
- [PULL 36/61] lockable: add QemuRecMutex support, Paolo Bonzini, 2020/03/16
- [PULL 40/61] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Paolo Bonzini, 2020/03/16
- [PULL 35/61] lockable: add lock guards, Paolo Bonzini, 2020/03/16
- [PULL 42/61] hw/display: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 30/61] qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl, Paolo Bonzini, 2020/03/16
- [PULL 34/61] cpus: avoid pause_all_vcpus getting stuck due to race, Paolo Bonzini, 2020/03/16
- [PULL 37/61] memory: Correctly return alias region type, Paolo Bonzini, 2020/03/16
- [PULL 38/61] memory: Simplify memory_region_init_rom_nomigrate() to ease review, Paolo Bonzini, 2020/03/16
- [PULL 39/61] scripts/cocci: Rename memory-region-{init-ram -> housekeeping}, Paolo Bonzini, 2020/03/16