[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/21] cpu: init vmstate for ticks and clock offset
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 14/21] cpu: init vmstate for ticks and clock offset |
Date: |
Fri, 12 Sep 2014 15:58:51 +0200 |
From: Pavel Dovgalyuk <address@hidden>
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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 8 ++++++--
include/qemu-common.h | 2 ++
vl.c | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
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) {
diff --git a/include/qemu-common.h b/include/qemu-common.h
index bcf7a6a..dcb57ab 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;
diff --git a/vl.c b/vl.c
index 15aea95..5db0d08 100644
--- a/vl.c
+++ b/vl.c
@@ -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");
--
2.1.0
- Re: [Qemu-devel] [PULL 05/21] rules.mak: Fix DSO build by pulling in archive symbols, (continued)
- [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/12
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/19
- Message not available
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/22
- Message not available
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/22
Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/26
[Qemu-devel] [PULL 14/21] cpu: init vmstate for ticks and clock offset,
Paolo Bonzini <=
[Qemu-devel] [PULL 15/21] fdc: adding vmstate for save/restore, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 12/21] vl: use QLIST_FOREACH_SAFE to visit change state handlers, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 16/21] parallel: adding vmstate for save/restore, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 17/21] serial: fixing vmstate for save/restore, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 19/21] mc146818rtc: add missed field to vmstate, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 18/21] piix: do not set irq while loading vmstate, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 20/21] pckbd: adding new fields to vmstate, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 21/21] gdbstub: init mon_chr through qemu_chr_alloc, Paolo Bonzini, 2014/09/12
Re: [Qemu-devel] [PULL 00/21] KVM, memory, build, migration changes for 2014-09-11, Peter Maydell, 2014/09/15