qemu_timer_pending and qemu_get_timer: don't crash if the timer passed
as an argument is NULL.
[ Fixes regression:
13b06e700528 broke save/restore on Xen. -iwj ]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
int qemu_timer_pending(QEMUTimer *ts)
{
QEMUTimer *t;
+
+ if (ts == NULL)
+ return 0;
+
for(t = active_timers[ts->clock->type]; t != NULL; t = t->next) {
if (t == ts)
return 1;
{
uint64_t expire_time;
+ if (ts == NULL)
+ return;
+
expire_time = qemu_get_be64(f);
if (expire_time != -1) {
qemu_mod_timer(ts, expire_time);