diff options
-rw-r--r-- | cpus.c | 8 | ||||
-rw-r--r-- | include/qemu-common.h | 2 | ||||
-rw-r--r-- | vl.c | 1 |
3 files changed, 9 insertions, 2 deletions
@@ -493,13 +493,17 @@ static const VMStateDescription vmstate_timers = { } }; +void cpu_ticks_init(void) +{ + seqlock_init(&timers_state.vm_clock_seqlock, NULL); + vmstate_register(NULL, 0, &vmstate_timers, &timers_state); +} + void configure_icount(QemuOpts *opts, Error **errp) { const char *option; char *rem_str = NULL; - seqlock_init(&timers_state.vm_clock_seqlock, NULL); - vmstate_register(NULL, 0, &vmstate_timers, &timers_state); option = qemu_opt_get(opts, "shift"); if (!option) { if (qemu_opt_get(opts, "align") != NULL) { diff --git a/include/qemu-common.h b/include/qemu-common.h index bcf7a6ad43..dcb57ab4b9 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -105,6 +105,8 @@ static inline char *realpath(const char *path, char *resolved_path) } #endif +void cpu_ticks_init(void); + /* icount */ void configure_icount(QemuOpts *opts, Error **errp); extern int use_icount; @@ -4334,6 +4334,7 @@ int main(int argc, char **argv, char **envp) qemu_spice_init(); #endif + cpu_ticks_init(); if (icount_opts) { if (kvm_enabled() || xen_enabled()) { fprintf(stderr, "-icount is not allowed with kvm or xen\n"); |