@@ -407,7 +407,7 @@ int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg);
* (or default timer list group, if NULL).
* The caller is responsible for allocating the memory.
*
- * You need not call an explicit deinit call. Simply make
+ * You need not call an explicit timer_deinit() call. Simply make
* sure it is not on a list with timer_del.
*/
void timer_init_full(QEMUTimer *ts,
@@ -354,6 +354,7 @@ void timer_init_full(QEMUTimer *ts,
if (!timer_list_group) {
timer_list_group = &main_loop_tlg;
}
+ assert(ts->timer_list == NULL);
ts->timer_list = timer_list_group->tl[type];
ts->cb = cb;
ts->opaque = opaque;
Ensure we are not re-initializing a QEMUTimer already added to an active list. timer_init*() functions expect either a recently created and zeroed QEMUTimer, or one previously free'd with timer_free(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/qemu/timer.h | 2 +- util/qemu-timer.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)