All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, dgilbert@redhat.com,
	Pavel.Dovgaluk@ispras.ru, quintela@redhat.com
Subject: [Qemu-devel] [PATCH 03/10] cpu: init vmstate for ticks and clock offset
Date: Tue,  9 Sep 2014 14:30:02 +0200	[thread overview]
Message-ID: <1410265809-27247-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1410265809-27247-1-git-send-email-pbonzini@redhat.com>

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

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 <Pavel.Dovgaluk@ispras.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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

  parent reply	other threads:[~2014-09-09 12:30 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 12:29 [Qemu-devel] [PATCH 00/10] x86: migrate more data Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 01/10] vl: use QLIST_FOREACH_SAFE to visit change state handlers Paolo Bonzini
2014-09-09 13:09   ` Juan Quintela
2014-09-09 12:30 ` [Qemu-devel] [PATCH 02/10] apic_common: vapic_paddr synchronization fix Paolo Bonzini
2014-09-09 13:10   ` Juan Quintela
2014-09-09 14:00   ` Michael S. Tsirkin
2014-09-09 14:26     ` Paolo Bonzini
2014-09-10  6:55   ` Pavel Dovgaluk
2014-09-09 12:30 ` Paolo Bonzini [this message]
2014-09-09 13:25   ` [Qemu-devel] [PATCH 03/10] cpu: init vmstate for ticks and clock offset Juan Quintela
2014-09-09 13:26     ` Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 04/10] pcspk: adding vmstate for save/restore Paolo Bonzini
2014-09-09 13:26   ` Juan Quintela
2014-09-09 13:28     ` Paolo Bonzini
2014-09-10 12:02       ` Michael S. Tsirkin
2014-09-10 10:59         ` Paolo Bonzini
2014-09-10 12:20           ` Michael S. Tsirkin
2014-09-10 11:24             ` Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 05/10] fdc: " Paolo Bonzini
2014-09-09 13:29   ` Juan Quintela
2014-09-09 12:30 ` [Qemu-devel] [PATCH 06/10] parallel: " Paolo Bonzini
2014-09-09 13:32   ` Juan Quintela
2014-09-09 13:40     ` Paolo Bonzini
2014-09-10 12:09       ` Michael S. Tsirkin
2014-09-10 11:16         ` Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 07/10] serial: fixing " Paolo Bonzini
2014-09-09 13:59   ` Juan Quintela
2014-09-09 16:24     ` Paolo Bonzini
2014-09-10 11:24       ` Pavel Dovgaluk
2014-09-10 10:41   ` Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 08/10] pckbd: adding new fields to vmstate Paolo Bonzini
2014-09-09 13:07   ` Juan Quintela
2014-09-10 10:14     ` Paolo Bonzini
2014-09-09 12:30 ` [Qemu-devel] [PATCH 09/10] piix: do not raise irq while loading vmstate Paolo Bonzini
2014-09-09 13:37   ` Juan Quintela
2014-09-09 13:54   ` Michael S. Tsirkin
2014-09-09 17:16     ` Paolo Bonzini
2014-09-09 20:51       ` Michael S. Tsirkin
2014-09-10  8:38         ` Paolo Bonzini
2014-09-10  8:51           ` Peter Maydell
2014-09-10  9:05             ` Paolo Bonzini
2014-09-10 10:20               ` Michael S. Tsirkin
2014-09-10 10:50           ` Michael S. Tsirkin
2014-09-10  9:58             ` Paolo Bonzini
2014-09-10 11:04               ` Michael S. Tsirkin
2014-09-10 10:07                 ` Paolo Bonzini
2014-09-10 11:26                   ` Michael S. Tsirkin
2014-09-09 12:30 ` [Qemu-devel] [PATCH 10/10] mc146818rtc: add missed field to vmstate Paolo Bonzini
2014-09-09 12:58   ` Juan Quintela
2014-09-10 10:50 ` [Qemu-devel] [PATCH 00/10] x86: migrate more data Paolo Bonzini
2014-09-10 11:56   ` Michael S. Tsirkin
2014-09-10 10:58     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410265809-27247-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.