From 4603ea01055ac3b6bca8b6c6f9e265c00955ce8f Mon Sep 17 00:00:00 2001 From: Pavel Dovgalyuk Date: Mon, 1 Sep 2014 09:34:49 +0400 Subject: cpu: init vmstate for ticks and clock offset Ticks and clock offset used by CPU timers have to be saved in vmstate. But vmstate for these fields registered only in icount mode. Missing registration leads to breaking the continuity when vmstate is loaded. This patch introduces new initialization function which fixes this. Signed-off-by: Pavel Dovgalyuk Signed-off-by: Paolo Bonzini --- cpus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpus.c') diff --git a/cpus.c b/cpus.c index 0f7d0ea..2a0e133 100644 --- a/cpus.c +++ b/cpus.c @@ -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) { -- cgit v1.1