]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commitdiff
qemu_get_timer: always read the 64 bit value from the savefile
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 8 Dec 2011 16:36:03 +0000 (16:36 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 8 Dec 2011 16:36:03 +0000 (16:36 +0000)
qemu_get_timer: the 64 bit value needs to be read from the save file
even when the timer is not initialized otherwise following reads from
the savefile will read the wrong fields.

[ This fixes a regression in 68af5b51 -iwj. ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
vl.c

diff --git a/vl.c b/vl.c
index f3b3d02ab57030b5cde4a514ca40d7d7b1447426..9e0a5564a386cccf94ef2cbe389a4757c2915a66 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1276,10 +1276,10 @@ void qemu_get_timer(QEMUFile *f, QEMUTimer *ts)
 {
     uint64_t expire_time;
 
+    expire_time = qemu_get_be64(f);
+
     if (ts == NULL)
         return;
-
-    expire_time = qemu_get_be64(f);
     if (expire_time != -1) {
         qemu_mod_timer(ts, expire_time);
     } else {