aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-12 16:21:44 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-10-21 18:14:30 +0200
commit2ff68d0738768643e796ab39f007c1f3858e67f1 (patch)
treee8abf0e3abba74a56bc1eebf2f749793a1d0e686 /savevm.c
parent4260a7391190d2d01fac50ee3d738a15bab6b98e (diff)
qemu-timer: move more stuff out of qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index cf79a56871..f01838fb2d 100644
--- a/savevm.c
+++ b/savevm.c
@@ -81,6 +81,7 @@
#include "migration.h"
#include "qemu_socket.h"
#include "qemu-queue.h"
+#include "qemu-timer.h"
#include "cpus.h"
#define SELF_ANNOUNCE_ROUNDS 5
@@ -712,6 +713,30 @@ uint64_t qemu_get_be64(QEMUFile *f)
return v;
}
+
+/* timer */
+
+void qemu_put_timer(QEMUFile *f, QEMUTimer *ts)
+{
+ uint64_t expire_time;
+
+ expire_time = qemu_timer_expire_time_ns(ts);
+ qemu_put_be64(f, expire_time);
+}
+
+void qemu_get_timer(QEMUFile *f, QEMUTimer *ts)
+{
+ uint64_t expire_time;
+
+ expire_time = qemu_get_be64(f);
+ if (expire_time != -1) {
+ qemu_mod_timer_ns(ts, expire_time);
+ } else {
+ qemu_del_timer(ts);
+ }
+}
+
+
/* bool */
static int get_bool(QEMUFile *f, void *pv, size_t size)