[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/62] vl: extract accelerator option processing to a separate fun
From: |
Paolo Bonzini |
Subject: |
[PULL 15/62] vl: extract accelerator option processing to a separate function |
Date: |
Mon, 16 Dec 2019 17:27:59 +0100 |
As a first step towards supporting multiple "-accel" options, push the
late processing of -icount and -accel into a new function, and use
qemu_opts_foreach to retrieve -accel options instead of stashing
them into globals.
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index 60353dc..6e454a0 100644
--- a/vl.c
+++ b/vl.c
@@ -2831,6 +2831,25 @@ static int do_configure_icount(void *opaque, QemuOpts
*opts, Error **errp)
return 0;
}
+static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp)
+{
+ if (tcg_enabled()) {
+ qemu_tcg_configure(opts, &error_fatal);
+ }
+ return 0;
+}
+
+static void configure_accelerators(void)
+{
+ qemu_opts_foreach(qemu_find_opts("accel"),
+ do_configure_accelerator, NULL, &error_fatal);
+
+ if (use_icount && !(tcg_enabled() || qtest_enabled())) {
+ error_report("-icount is not allowed with hardware virtualization");
+ exit(1);
+ }
+}
+
int main(int argc, char **argv, char **envp)
{
int i;
@@ -4235,14 +4254,7 @@ int main(int argc, char **argv, char **envp)
qemu_spice_init();
cpu_ticks_init();
- if (use_icount && !(tcg_enabled() || qtest_enabled())) {
- error_report("-icount is not allowed with hardware virtualization");
- exit(1);
- }
-
- if (tcg_enabled()) {
- qemu_tcg_configure(accel_opts, &error_fatal);
- }
+ configure_accelerators();
if (default_net) {
QemuOptsList *net = qemu_find_opts("net");
--
1.8.3.1
- [PULL 04/62] migration-test: Move -machine to common commandline, (continued)
- [PULL 04/62] migration-test: Move -machine to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 05/62] migration-test: Move memory size to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 06/62] migration-test: Move shmem handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 07/62] migration-test: Move -name handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 09/62] migration-test: Move -incomming handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 08/62] migration-test: Move -serial handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 10/62] migration-test: Rename cmd_src/dst to arch_source/arch_target, Paolo Bonzini, 2019/12/16
- [PULL 12/62] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/12/16
- [PULL 11/62] migration-test: Use a struct for test_migrate_start parameters, Paolo Bonzini, 2019/12/16
- [PULL 13/62] vl: move icount configuration earlier, Paolo Bonzini, 2019/12/16
- [PULL 15/62] vl: extract accelerator option processing to a separate function,
Paolo Bonzini <=
- [PULL 14/62] tcg: move qemu_tcg_configure to accel/tcg/tcg-all.c, Paolo Bonzini, 2019/12/16
- [PULL 17/62] accel: compile accel/accel.c just once, Paolo Bonzini, 2019/12/16
- [PULL 16/62] vl: merge -accel processing into configure_accelerators, Paolo Bonzini, 2019/12/16
- [PULL 18/62] vl: introduce object_parse_property_opt, Paolo Bonzini, 2019/12/16
- [PULL 20/62] vl: warn for unavailable accelerators, clarify messages, Paolo Bonzini, 2019/12/16
- [PULL 21/62] qom: introduce object_register_sugar_prop, Paolo Bonzini, 2019/12/16
- [PULL 22/62] qom: add object_new_with_class, Paolo Bonzini, 2019/12/16
- [PULL 24/62] tcg: convert "-accel threads" to a QOM property, Paolo Bonzini, 2019/12/16
- [PULL 23/62] accel: pass object to accel_init_machine, Paolo Bonzini, 2019/12/16
- [PULL 19/62] vl: configure accelerators from -accel options, Paolo Bonzini, 2019/12/16