qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: KONRAD Frederic <fred.konrad@greensocs.com>
Subject: [Qemu-devel] [PULL 03/11] migration: migrate icount fields.
Date: Wed,  6 Aug 2014 18:12:27 +0200	[thread overview]
Message-ID: <1407341555-13173-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1407341555-13173-1-git-send-email-pbonzini@redhat.com>

From: KONRAD Frederic <fred.konrad@greensocs.com>

This fixes a bug where qemu_icount and qemu_icount_bias are not migrated.
It adds a subsection "timer/icount" to vmstate_timers so icount is migrated only
when needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 cpus.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/cpus.c b/cpus.c
index 127de1c..a6b6557 100644
--- a/cpus.c
+++ b/cpus.c
@@ -429,6 +429,25 @@ void qemu_clock_warp(QEMUClockType type)
     }
 }
 
+static bool icount_state_needed(void *opaque)
+{
+    return use_icount;
+}
+
+/*
+ * This is a subsection for icount migration.
+ */
+static const VMStateDescription icount_vmstate_timers = {
+    .name = "timer/icount",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_INT64(qemu_icount_bias, TimersState),
+        VMSTATE_INT64(qemu_icount, TimersState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static const VMStateDescription vmstate_timers = {
     .name = "timer",
     .version_id = 2,
@@ -438,6 +457,14 @@ static const VMStateDescription vmstate_timers = {
         VMSTATE_INT64(dummy, TimersState),
         VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2),
         VMSTATE_END_OF_LIST()
+    },
+    .subsections = (VMStateSubsection[]) {
+        {
+            .vmsd = &icount_vmstate_timers,
+            .needed = icount_state_needed,
+        }, {
+            /* empty */
+        }
     }
 };
 
-- 
1.9.3

  parent reply	other threads:[~2014-08-06 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 16:12 [Qemu-devel] [PULL 00/11] KVM, icount changes for 2014-08-06 Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 01/11] backends: Introduce chr-testdev Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 02/11] icount: put icount variables into TimerState Paolo Bonzini
2014-08-06 16:12 ` Paolo Bonzini [this message]
2014-08-06 16:12 ` [Qemu-devel] [PULL 04/11] timer: add cpu_icount_to_ns function Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 05/11] icount: Fix virtual clock start value on ARM Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 06/11] icount: Add QemuOpts for icount Paolo Bonzini
2015-06-25 10:33   ` Peter Maydell
2014-08-06 16:12 ` [Qemu-devel] [PULL 07/11] icount: Add align option to icount Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 08/11] cpu-exec: Add sleeping algorithm Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 09/11] cpu-exec: Print to console if the guest is late Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 10/11] monitor: Add drift info to 'info jit' Paolo Bonzini
2014-08-06 16:12 ` [Qemu-devel] [PULL 11/11] target-mips: Ignore unassigned accesses with KVM Paolo Bonzini
2014-08-07 11:28 ` [Qemu-devel] [PULL 00/11] KVM, icount changes for 2014-08-06 Peter Maydell

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=1407341555-13173-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=fred.konrad@greensocs.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).