diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-09-12 16:21:44 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-10-21 18:14:30 +0200 |
commit | 2ff68d0738768643e796ab39f007c1f3858e67f1 (patch) | |
tree | e8abf0e3abba74a56bc1eebf2f749793a1d0e686 /savevm.c | |
parent | 4260a7391190d2d01fac50ee3d738a15bab6b98e (diff) | |
download | qemu-2ff68d0738768643e796ab39f007c1f3858e67f1.tar.gz qemu-2ff68d0738768643e796ab39f007c1f3858e67f1.tar.bz2 qemu-2ff68d0738768643e796ab39f007c1f3858e67f1.zip |
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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) |