qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 02/12] migration: migrate icount fields.


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH 02/12] migration: migrate icount fields.
Date: Sat, 22 Mar 2014 09:57:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Il 21/03/2014 20:17, address@hidden ha scritto:
From: KONRAD Frederic <address@hidden>

This fixes a bug where qemu_icount and qemu_icount_bias are not migrated.

Signed-off-by: KONRAD Frederic <address@hidden>
---
 cpus.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/cpus.c b/cpus.c
index 687717f..bdbc431 100644
--- a/cpus.c
+++ b/cpus.c
@@ -440,12 +440,33 @@ static const VMStateDescription vmstate_timers = {
     }
 };

+/*
+ * This is used instead of vmstate_timers when icount is used.
+ * cpu_ticks_offset and dummy fields are unused in icount mode so we can 
replace
+ * them with icount variables.
+ */
+static const VMStateDescription icount_vmstate_timers = {
+    .name = "timer",
+    .version_id = 2,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields      = (VMStateField[]) {
+        VMSTATE_INT64(qemu_icount_bias, TimersState),
+        VMSTATE_INT64(qemu_icount, TimersState),
+        VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 void configure_icount(const char *option)
 {
     seqlock_init(&timers_state.vm_clock_seqlock, NULL);
-    vmstate_register(NULL, 0, &vmstate_timers, &timers_state);
+
     if (!option) {
+        vmstate_register(NULL, 0, &vmstate_timers, &timers_state);
         return;
+    } else {
+        vmstate_register(NULL, 0, &icount_vmstate_timers, &timers_state);
     }

     icount_warp_timer = timer_new_ns(QEMU_CLOCK_REALTIME,


You can also use a subsection for this.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]