[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/87] vl: move icount configuration earlier
From: |
Paolo Bonzini |
Subject: |
[PULL 13/87] vl: move icount configuration earlier |
Date: |
Wed, 18 Dec 2019 13:01:39 +0100 |
Once qemu_tcg_configure is turned into a QOM property setter, it will not
be able to set a default value for mttcg_enabled. Setting the default will
move to the TCG instance_init function, which currently runs before "-icount"
is processed.
However, it is harmless to do configure_icount for all accelerators; we will
just fail later if a non-TCG accelerator is selected. So do that.
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/vl.c b/vl.c
index 9450830..6e58c1d 100644
--- a/vl.c
+++ b/vl.c
@@ -2700,6 +2700,12 @@ static void user_register_global_props(void)
global_init_func, NULL, NULL);
}
+static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp)
+{
+ configure_icount(opts, errp);
+ return 0;
+}
+
int main(int argc, char **argv, char **envp)
{
int i;
@@ -4010,6 +4016,8 @@ int main(int argc, char **argv, char **envp)
* Note: uses machine properties such as kernel-irqchip, must run
* after machine_set_property().
*/
+ qemu_opts_foreach(qemu_find_opts("icount"),
+ do_configure_icount, NULL, &error_fatal);
configure_accelerator(current_machine, argv[0]);
/*
@@ -4095,13 +4103,9 @@ int main(int argc, char **argv, char **envp)
qemu_spice_init();
cpu_ticks_init();
- if (icount_opts) {
- if (!tcg_enabled()) {
- error_report("-icount is not allowed with hardware
virtualization");
- exit(1);
- }
- configure_icount(icount_opts, &error_abort);
- qemu_opts_del(icount_opts);
+ if (use_icount && !(tcg_enabled() || qtest_enabled())) {
+ error_report("-icount is not allowed with hardware virtualization");
+ exit(1);
}
if (tcg_enabled()) {
--
1.8.3.1
- [PULL 02/87] migration-test: Create cmd_soure and cmd_target, (continued)
- [PULL 02/87] migration-test: Create cmd_soure and cmd_target, Paolo Bonzini, 2019/12/18
- [PULL 03/87] migration-test: Move hide_stderr to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 04/87] migration-test: Move -machine to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 06/87] migration-test: Move shmem handling to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 05/87] migration-test: Move memory size to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 07/87] migration-test: Move -name handling to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 08/87] migration-test: Move -serial handling to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 09/87] migration-test: Move -incomming handling to common commandline, Paolo Bonzini, 2019/12/18
- [PULL 14/87] tcg: move qemu_tcg_configure to accel/tcg/tcg-all.c, Paolo Bonzini, 2019/12/18
- [PULL 15/87] vl: extract accelerator option processing to a separate function, Paolo Bonzini, 2019/12/18
- [PULL 13/87] vl: move icount configuration earlier,
Paolo Bonzini <=
- [PULL 12/87] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/12/18
- [PULL 11/87] migration-test: Use a struct for test_migrate_start parameters, Paolo Bonzini, 2019/12/18
- [PULL 16/87] vl: merge -accel processing into configure_accelerators, Paolo Bonzini, 2019/12/18
- [PULL 22/87] qom: add object_new_with_class, Paolo Bonzini, 2019/12/18
- [PULL 23/87] accel: pass object to accel_init_machine, Paolo Bonzini, 2019/12/18
- [PULL 25/87] tcg: add "-accel tcg,tb-size" and deprecate "-tb-size", Paolo Bonzini, 2019/12/18
- [PULL 31/87] object: Improve documentation of interfaces, Paolo Bonzini, 2019/12/18
- [PULL 32/87] build-sys: build vhost-user-gpu only if CONFIG_TOOLS, Paolo Bonzini, 2019/12/18
- [PULL 26/87] xen: convert "-machine igd-passthru" to an accelerator property, Paolo Bonzini, 2019/12/18
- [PULL 18/87] vl: introduce object_parse_property_opt, Paolo Bonzini, 2019/12/18